count = 0 while True: x = int(input()) if x == 0: break y = list(map(int, input().split())) avg = int(sum(y)/x) a = 0 for i in y: a += abs(i-avg) count += 1 print('Set #' + str(count)) print('The minimum number of moves is', str(a//2) + '.') print()