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