#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0, f = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = 100000;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x + f;
}
bool hsh[200005];
int n;
int cnt = 0;
int main() {
  memset(hsh, 0, sizeof(hsh));
  n = read();
  for (int i = 1; i <= n; i++) {
    int temp = read();
    if (hsh[temp] == 0 && temp != 0) {
      cnt++;
      hsh[temp] = 1;
    }
  }
  cout << cnt << endl;
}
