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