#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i = 0, coun = 0;
  cin >> n;
  int num[n];
  for (int i = 0; i < n; i++) cin >> num[i];
  sort(num, num + n);
  for (int i = 0; i < n; i++) {
    if (num[i] != 0 && num[i] != num[i + 1]) coun++;
  }
  cout << coun << "\n";
}
