#include <bits/stdc++.h>
using namespace std;
const int MAX_BUF_SIZE = 16384;
char BUFOR[MAX_BUF_SIZE];
int BUF_SIZE, BUF_POS;
char ZZZ;
const int MXN = 2000010;
const int C = 262144;
const int MOD = 1000000009;
int n, m;
int main() {
  scanf("%d", &n);
  int sum = 0;
  for (int i = (1); i <= (n); i++) {
    scanf("%d", &m);
    sum += m;
  }
  if (sum % n == 0)
    printf("%d\n", n);
  else
    printf("%d\n", n - 1);
  return 0;
}
