#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> vc(n);
  for (int i = 0; i < n; i++) cin >> vc[i];
  sort(vc.begin(), vc.end());
  int f, s, j;
  for (int i = 0; i < n; i++) {
    if (vc[i] != 0) {
      f = 1;
      s = (-1) * vc[i];
      j = i + 1;
      break;
    } else
      f = 0;
  }
  while (j < n) {
    if (vc[j] != 0) {
      if (s + vc[j] != 0) {
        f++;
        s = (-1) * vc[j];
      }
    }
    j++;
  }
  cout << f << endl;
}
