#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (cin >> n) {
    int total = 0, num;
    for (int i = 0; i < n; i++) {
      cin >> num;
      total += num;
    }
    if (total % n == 0)
      cout << n << endl;
    else
      cout << n - 1 << endl;
  }
  return 0;
}
