#include <bits/stdc++.h>
using namespace std;
int N[100010];
int main() {
  int n, i, j, sum, t;
  while (scanf("%d", &n) != EOF) {
    for (sum = 0, i = 1; i <= n; i++) {
      scanf("%d", &t);
      sum += t;
    }
    if (sum % n == 0)
      printf("%d\n", n);
    else {
      printf("%d\n", n - 1);
    }
  }
  return 0;
}
