#include <bits/stdc++.h>
using namespace std;
int Get() {
  char c;
  while (c = getchar(), (c < '0' || c > '9') && c != '-')
    ;
  bool Flag = (c == '-');
  if (Flag) c = getchar();
  int X = 0;
  while (c >= '0' && c <= '9') {
    X = X * 10 + c - 48;
    c = getchar();
  }
  return Flag ? -X : X;
}
int main() {
  int N = Get(), Sum = 0;
  for (int i = 0; i < N; i++) Sum += Get();
  printf("%d\n", (Sum % N) ? (N - 1) : N);
  return 0;
}
