#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10, INF = 0x3f3f3f3f, mod = 1e9 + 7;
int n;
int a[N], ans[N];
bool st[N];
using namespace std;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
inline int read() {
  int date = 0, w = 1;
  char c = 0;
  while (c < '0' || c > '9') {
    if (c == '-') w = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    date = date * 10 + c - '0';
    c = getchar();
  }
  return date * w;
}
long long qmi(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return res;
}
int main() {
  map<int, int> mp;
  int n, x;
  int ans = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &x);
    if (x && !mp[x]) {
      ans++;
      mp[x] = 1;
    }
  }
  cout << ans << endl;
  return 0;
}
