#include <bits/stdc++.h>
using namespace std;
template <class T>
bool checkMin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool checkMax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
const int INF = 1e9;
const int MN = 1e5 + 5;
int n, r, m;
int main() {
  scanf("%d", &n);
  m = 0;
  for (int i = 0; i < (n); i++) {
    int u;
    scanf("%d", &u);
    m += u;
  }
  if (m % n == 0)
    r = n;
  else
    r = n - 1;
  printf("%d\n", r);
}
