//前缀和
#include <iostream>
using namespace std;
const int N = 110;
int a[N], s[N];
int main()
{
int n;
cin >> n;
for(int i = 0; i < n; i ++) cin >> a[i], s[i + 1] = s[i] + a[i];
int ave = s[n] / n, cnt = n;
for(int i = 0; i < n; i ++) if(s[i] == ave * i) cnt --;
cout << cnt <<endl;
return 0;
}