#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sum = 0;
  double res = 0;
  int res2 = 1;
  cin >> n;
  int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  double t = (sum * 1.0) / n;
  if (ceil(t) == t)
    res2 = n;
  else
    res2 = n - 1;
  cout << res2 << endl;
  return 0;
}
