/*
author :hzoi_ztx
title :
ALG :
comment:
[2014 10 14 test]
*/
#include <cstdio>
#define maxn 105
int n , t = 0 , ans = 0 ;
int a[maxn] = {0} ;
int main() {
#define READ
#ifdef READ
freopen("jfzp.in" ,"r",stdin ) ;
freopen("jfzp.out","w",stdout) ;
#endif
int i ;
scanf("%d", &n ) ;
for (i = 1 ; i <= n ; i ++ ) {
scanf("%d", &a[i] ) ; t += a[i] ;
}
t /= n ;
for (i = 1 ; i <= n ; i ++ ) {
if (a[i] != t) ans ++ ;
a[i+1] += a[i]-t ;
}
printf("%d\n", ans ) ;
return 0 ;
}