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