#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const int MAX = 100005;
const int MAX1 = 2007;
const int MAX2 = 4007;
const int LEN = 21;
const int BASE = 1000000000;
const double EPS = 1e-7;
const int MOD = 1234567891;
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ifstream in("");
  ofstream out("");
  int n;
  cin >> n;
  set<int> S;
  for (int i = (0); i < (n); ++i) {
    int tmp;
    cin >> tmp;
    if (tmp != 0) S.insert(tmp);
  }
  cout << (int)S.size() << endl;
  return 0;
}
