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