n = int(input()) l = list(map(int, input().split())) x = sum(l)/10 y = 0 for i in l: if i <= x: y += 1 print(y*30)