N = int(input()) C = [int(i) for i in input().split()] for i in range(N): if C[i] > sum(C)/10: N -= 1 print(N*30)