#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, x, mn = 1000000, ans = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &x);
    ans += x;
    mn = ((mn) < (x) ? (mn) : (x));
  }
  printf("%d", n - (ans % n != 0));
  return 0;
}
