#include <iostream>
#include <map>
using namespace std;
map<int, int> mp;
int main(){
int n; cin >> n;
int cnt = 0;
for(int i = 0; i < n; i ++ ){
int tmp; cin >> tmp;
cnt += mp[-tmp];
mp[tmp] ++ ;
}
cout << cnt << endl;
return 0;
}