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