#include <bits/stdc++.h>
using namespace std;
const int maxn = 1010;
const int maxm = 1000010;
const int inf = 1 << 30;
int n, m;
int tot, ans;
int main() {
  scanf("%d", &n);
  int x;
  tot = 0;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &x);
    tot += x;
  }
  if (tot % n == 0)
    printf("%d\n", n);
  else
    printf("%d\n", n - 1);
  return 0;
}
