#include <bits/stdc++.h>
inline int readInt() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = 0;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + (ch - '0');
    ch = getchar();
  };
  if (f) return x;
  return -x;
}
const int N = 1e5 + 7;
int n, a[N], sum;
int main() {
  sum = 0;
  n = readInt();
  for (int i = 1; i <= n; ++i) {
    a[i] = readInt();
    sum += a[i];
  }
  int d = sum / n, m = 0;
  for (int i = 1; i <= n; ++i) {
    if (a[i] < d)
      m += (d - a[i]);
    else
      m -= (a[i] - d);
  }
  if (m == 0)
    printf("%d", n);
  else
    printf("%d", n - 1);
  return 0;
}
