#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, cnt = 0;
  cin >> n;
  map<int, int> p;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (p[x] == 0 && x != 0) {
      cnt++;
      p[x] = 1;
    }
  }
  cout << cnt;
  return 0;
}
