#include<bits/stdc++.h> using namespace std; int main(){ int a,b[101],c=0,d=0,e=0,s=0; cin>>a; for(int i=1;i<=a;i++) { cin>>b[i]; e+=b[i]; } e=e/a; for(int i=1;i<=a;i++) { if(b[i]!=e) { b[i]=b[i+1]-e+b[i]; s++; } } cout<<s; return 0; }