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