N = int(input())
Vote = list(map(int,input().split()))
voder = sum(Vote)/10
people = 0
for v in Vote:
    if v <= voder:
        people += 1
print(people*30)