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