N = int(input())
C = list(map(int, input().split()))
ans = 0
for i in range(N):
    if sum(C) / 10 >= C[i]:
        ans += 1
print(ans * 30)