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