#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000 * 100 + 10, INF = 1e9 + 10;
int a[MAXN];
int main() {
  ios::sync_with_stdio(false);
  long long n, s = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    s += a[i];
  }
  while (s < 0) s += ((n) * (n));
  if (s % n == 0)
    cout << n << endl;
  else
    cout << n - 1 << endl;
  return 0;
}
