#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k, n, x, ans, mn;
  cin >> n;
  ans = 0;
  for (i = 0; i < n; i++) {
    cin >> x;
    ans += x;
  }
  if (ans % n == 0)
    cout << n << endl;
  else
    cout << n - 1 << endl;
}
