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