#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, x, s;
  vector<int> v;
  cin >> t;
  s = 0;
  for (int i = 0; i < t; i++) {
    cin >> x;
    s += x;
    v.push_back(x);
  }
  x = 0;
  s /= t;
  for (int i = 0; i < t; i++) {
    if (v[i] != s) {
      x++;
    }
  }
  cout << x << endl;
  return 0;
}
