n = int(input()) c = list(map(int, input().split())) print(30 * sum([1 & (x / sum(c) <= 0.1) for x in c]))