#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
int main() {
  int n;
  scanf("%d", &n);
  int x;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &x);
    if (x and mp[x] == 0) {
      mp[x] = 1;
      ans++;
    }
  }
  cout << ans << endl;
}
