#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e18 + 7;
const long long N = 2e6 + 5;
int main() {
  long long i, j, k, l = 0;
  long long n, m, t;
  cin >> n;
  for (long long i = 0; i < n; i++) cin >> k, l += k;
  if (l % n)
    cout << n - 1 << endl;
  else
    cout << n << endl;
  return 0;
}
