#include <iostream>
using namespace std;
const int N = 110;
int a[N];
int main()
{
int n;
cin>>n;
int total = 0;
for(int i=0;i<n;i++) cin>>a[i],total += a[i];
int avg = total /n;
for(int i=0;i<n;i++) a[i] -= avg;
int ans = 0, tmp = 0;
for(int i=0;i<n;i++)
{
tmp += a[i];
if(tmp!=0) ans++;
}
cout<<ans<<endl;
return 0;
}