#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c *x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug &operator<<(const c &) {
    return *this;
  }
};
template <typename T>
T set_bit(T N, T pos) {
  return N = N | (1 << pos);
}
template <typename T>
T reset_bit(T N, T pos) {
  return N = N & ~(1 << pos);
}
template <typename T>
bool check_bit(T N, T pos) {
  return (bool)(N & (1 << pos));
}
template <typename T>
void bin_print(T N) {
  bitset<25> bit(N);
  cerr << bit.to_string() << "\n";
}
template <typename T>
void max_self(T &a, T b) {
  a = max(a, b);
}
template <typename T>
void min_self(T &a, T b) {
  a = min(a, b);
}
template <typename T>
void add_self(T &a, T b) {
  a += b;
}
template <typename T>
void ara_read(T &v, long long int n) {
  long long int temp;
  for (long long int i = 0; i < n; i++) {
    scanf("%lld", &temp);
    v.emplace_back(temp);
  }
}
template <typename T>
void ara_print(T &v) {
  for (long long int x : v) printf("%lld ", x);
  puts("");
}
const long long int INF = 2e18 + 99;
;
int main() {
  ios_base::sync_with_stdio(0);
  ;
  int n;
  cin >> n;
  map<int, int> m;
  for (int i = 0; i < n; i++) {
    int temp;
    cin >> temp;
    if (temp) m[temp]++;
  }
  int ans = (int)m.size();
  cout << ans << '\n';
  return 0;
}
