n = int(input()) ls = list(map(int, input().split())) amount = 0 for e in ls: if e <= sum(ls) / 10: amount += 30 print(amount)