n = int(input()) c_list = list(map(int,input().split())) possible = sum(c_list) standard = possible / 10 money = 0 for i in range(n): if c_list[i] <= standard: money += 30 res = money print(res)