#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int dummy;
  int tot = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &dummy);
    tot += dummy;
  }
  int ans;
  if (tot % n == 0)
    ans = n;
  else
    ans = n - 1;
  printf("%d\n", ans);
  return 0;
}
