#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9 + 7;
const int mxn = (int)2e5 + 7;
map<int, int> m;
map<int, int>::reverse_iterator it;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int a[n + 5];
  set<int> s;
  set<int>::iterator it;
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    s.insert(a[i]);
  }
  for (it = s.begin(); it != s.end(); it++) {
    if (*it != 0) cnt++;
  }
  cout << cnt;
}
