N = int(input()) L = list(map(int,input().split())) line = N/10 ans = 0 for i in range(N) : if L[i] <= line : ans += 30 print(ans)