#include<bits/stdc++.h>
using namespace std;
int a[1000001],n,s=0;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    freopen("CAU2.INP","r",stdin);
    freopen("CAU2.OUT","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++)
        cin>>a[i];
    sort(a+1,a+n+1);
    for(int i=1;i<=n;i++)
    {
        int x=lower_bound(a+i+1,a+n+1,-a[i])-a;
        int y=upper_bound(a+i+1,a+n+1,-a[i])-a;
        s+=y-x;
    }
    cout<<s;
    return 0;
}
