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