int main(int argc, char const* argv[])
{
int n;
int i = 0;
int r[50];
while(~scanf("%d",&n) && n != 0){
int sum = 0;
int p = n;
int j = 0;
while(n--){
int h;
scanf("%d",&h);
sum = sum+h;
r[j++] = h;
}
int avg = sum/p;
int ans = 0;
for(int u = 0;u<p;u++){
if(r[u]>avg)
ans = ans+r[u]-avg;
}
printf("Set #%d\n",++i);
printf("The minimum number of moves is %d.\n\n",ans);
}
return 0;
}