#include <bits/stdc++.h>
using namespace std;
bool a[200087];
int main(void) {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int temp;
    cin >> temp;
    a[temp + 100000] = true;
  }
  int ans = 0;
  for (int i = 0; i <= 200000; i++) {
    if (i != 100000 && a[i] == true) {
      ans++;
    }
  }
  cout << ans;
  return 0;
}
