class Problem0191: def solve(this): n = int(input()) c = list(map(int, input().split())) t = sum(c) * 0.1 res = 0 for i in c: if i < t: res += 30 print(res) if __name__ == "__main__": problem = Problem0191() problem.solve()