#include <bits/stdc++.h>
using namespace std;
set<int> s;
const int N = 1e5 + 10;
int a[N], n;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    if (a[i]) s.insert(a[i]);
  }
  printf("%d\n", s.size());
  return 0;
}
