#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
inline int digit(int n) { return floor(log10(n)) + 1; }
inline vector<string> split(string s) {
  string tmp;
  vector<string> out;
  for (int i = 0; s[i]; i++) {
    if (s[i] != ' ' || i == s.length() - 1) tmp += s[i];
    if (s[i] == ' ' || i == s.length() - 1) {
      out.push_back(tmp);
      tmp = "";
    }
  }
  return out;
}
void solve() {
  int n, t = 0;
  cin >> n;
  for (int i = 0; i < n; i += 1) {
    int v;
    cin >> v;
    t += v;
  }
  if (t % n == 0)
    cout << n << endl;
  else
    cout << n - 1 << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
