#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  long long sum = 0;
  for (int i = 0; i < n; ++i) {
    int t1;
    cin >> t1;
    sum += t1;
  }
  if (sum % n)
    cout << n - 1 << endl;
  else
    cout << n << endl;
  return 0;
}
