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