n = int(input()) C = list(map(int, input().split())) total = sum(C) if sum(C) != 0 else float("inf") print(sum([30 if c / total <= 0.1 else 0 for c in C]))