#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int i;
  int arr[n];
  long long int sum = 0;
  for (i = 0; i < n; i++) {
    cin >> arr[i];
    sum += arr[i];
  }
  long long int avg = sum / n;
  int surp = 0;
  for (i = 0; i < n; i++) {
    surp += (avg - arr[i]);
  }
  int ans = 0;
  if (surp == 0) {
    ans = n;
  } else {
    ans = n - 1;
  }
  cout << ans << '\n';
  return 0;
}
