#include <bits/stdc++.h>
using namespace std;
bool fastsort(int x, int y) { return x > y; }
int cmp_str(int x, string s1) {
  int ans;
  string s;
  while (x > 0) {
    ans = x % 10;
    x /= 10;
    s += (ans + 48);
  }
  if (s == s1) {
    return 1;
  }
  return 0;
}
int to_int(int x, string s) {
  int p = 1;
  for (int i = s.size() - 1; i >= 0; i--) {
    x += (s[i] - 48) * p;
    p *= 10;
  }
  return x;
}
vector<int> v;
set<int> se;
string s, s1;
pair<int, int> pa;
long long a, b[100001], c, ans, cnt, x1, y2, x2, d[100001];
int main() {
  cin >> a;
  for (int i = 1; i <= a; i++) {
    cin >> b[i];
    if (b[i] != 0) {
      se.insert(b[i]);
    }
  }
  cout << se.size();
  return 0;
}
