#include<bits/stdc++.h>
using namespace std;
void split(string & str, vector<long long> & result, char ch = ',') {
result.clear();
istringstream is(str);
string tmp;
while (getline(is, tmp, ch)) {
result.push_back(stoi(tmp));
}
}
int main()
{
string str;
getline(cin, str);
vector<long long> result;
split(str, result);
long long len = result.size();
if (len == 0 || len == 1) {
cout << 0;
return 0;
}
sort(result.begin(), result.end());
long long i = 0;
long long j = len - 1;
long long sum = 0;
while (i < j) {
if (result[i] + result[j] == 0) {
sum++;
i++;
j--;
}
else if (result[i] + result[j] > 0) {
j--;
}
else {
i++;
}
}
cout << sum << endl;
return 0;
}