#include <bits/stdc++.h>
using namespace std;
int n, x, ans;
bool us[200005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> x;
    x += 100000;
    if (!us[x] && x != 100000) ans++;
    us[x] = 1;
  }
  cout << ans;
}
