#include <bits/stdc++.h>
int num[100000];
int main() {
  int n, ans = 0;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    ans += a;
  }
  int sum = 0;
  if (ans % n == 0) {
    sum = n;
  } else
    sum = n - 1;
  printf("%d\n", sum);
  return 0;
}
