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