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