Polycarpus has an array, consisting of *n* integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub>. Polycarpus likes it when numbers in an array match. That's why he wants the array to have as many equal numbers as possible. For that Polycarpus performs the following operation multiple times:
 -  he chooses two elements of the array *a*<sub class="lower-index">*i*</sub>, *a*<sub class="lower-index">*j*</sub> (*i* ≠ *j*); -  he simultaneously increases number *a*<sub class="lower-index">*i*</sub> by 1 and decreases number *a*<sub class="lower-index">*j*</sub> by 1, that is, executes *a*<sub class="lower-index">*i*</sub> = *a*<sub class="lower-index">*i*</sub> + 1 and *a*<sub class="lower-index">*j*</sub> = *a*<sub class="lower-index">*j*</sub> - 1. 
The given operation changes exactly two distinct array elements. Polycarpus can apply the described operation an infinite number of times. 

Now he wants to know what maximum number of equal array elements he can get if he performs an arbitrary number of such operation. Help Polycarpus.
The first line contains integer *n* (1 ≤ *n* ≤ 10<sup class="upper-index">5</sup>) — the array size. The second line contains space-separated integers *a*<sub class="lower-index">1</sub>, *a*<sub class="lower-index">2</sub>, ..., *a*<sub class="lower-index">*n*</sub> (|*a*<sub class="lower-index">*i*</sub>| ≤ 10<sup class="upper-index">4</sup>) — the original array.
# https://codeforces.com/problemset/problem/246/B

"""
Array of n integers a_1, ..., a_n. Want to have as many equal numbers as possible
Can perform the following operation multiple times:
    * Choose two indices in the array i != j
    * Increase a_i by 1 and decrease a_j by -1

Find out the max number of arrays we can turn equal.

First notice that the operation is like a conservation law. The sum must be the same
However we can achieve any configuration that has the same sum. We just take a ball out of one
and put that ball in another.
"""

n = int(input())
a = list(map(int, input().split()))
s = sum(a)

if s % n == 0:
    print(n)
else:
    print(n-1)