#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
const int INF = 1 << 28;
const long long INFL = 1LL << 62;
const double INFD = 1e+20;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  int t;
  int sum = 0;
  for (int i = 0; i < n; ++i) {
    cin >> t;
    sum += t;
  }
  if (sum % n)
    cout << n - 1 << endl;
  else
    cout << n << endl;
}
