#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e5 + 55;
const int INF = 1e9 + 77;
const int MOD = 1e9 + 7;
const double PI = 2 * acos(0.0);
const double EPS = 1e-7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  long long sum = 0;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    sum += x;
  }
  if (sum % n == 0)
    cout << n;
  else
    cout << n - 1;
  return 0;
}
