#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n;
  cin >> n;
  long long int a = 0;
  for (long long int i = 0; i < n; i++) {
    long long int s;
    cin >> s;
    a += s;
  }
  if (a % n == 0) {
    cout << n;
    return;
  } else {
    cout << n - 1;
    return;
  }
}
signed main() {
  solve();
  return 0;
}
