#include <bits/stdc++.h>
long double PI = acos(-1.0);
using namespace std;
void solve() {
  int n;
  cin >> n;
  int sum = 0;
  for (long long int i = 0; i < n; i++) {
    int a;
    cin >> a;
    sum = sum + a;
  }
  if (abs(sum) % n == 0) {
    cout << n << "\n";
  } else {
    cout << n - 1 << "\n";
  }
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  solve();
}
