#include <bits/stdc++.h>
using namespace std;
long long OO = 100000000;
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  int a;
  set<int> myset;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a != 0) myset.insert(a);
  }
  cout << myset.size();
}
