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