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