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