201403-1 相反数
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
const int MAXN = 510;
int n, a[MAXN];
int cnt[MAXN];
int main() {
scanf("%d", &n);
for (int i = 0; i < n; ++i) {
scanf("%d", &a[i]);
cnt[abs(a[i])]++;
}
int res = 0;
for (int i = 0; i < n; ++i)
if (cnt[abs(a[i])] == 2) res++;
res /= 2;
printf("%d", res);
return 0;
}