#include <bits/stdc++.h>
using namespace std;
int a[100000];
int main() {
  int n, s, e;
  int sum1 = 0, sum2 = 0;
  cin >> n;
  set<int> s1;
  for (int i = 0; i < n; ++i) {
    cin >> s;
    s1.insert(s);
  }
  set<int>::iterator it;
  set<int>::iterator iy;
  it = s1.begin();
  iy = s1.end();
  if (*it == 0 && *iy == 0)
    cout << "0";
  else {
    for (it = s1.begin(); it != s1.end(); ++it) {
      if (*it != 0) sum1++;
    }
    cout << sum1 << endl;
  }
  return 0;
}
