#include <bits/stdc++.h>
using namespace std;
int n, cnt;
int arr[2 * 1000010];
int mat[110][110];
bool npr[1000010];
set<int> st;
int gcd(int a, int b) { return (b == 0 ? a : gcd(b, a % b)); }
int main() {
  int s = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    s += arr[i];
  }
  if (s % n == 0)
    cout << n << endl;
  else
    cout << n - 1 << endl;
  return 0;
}
