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