N = int(input()) C = list(map(int, input().split())) s = sum(C) print(len(list(filter(lambda x: x<=s/10, C)))*30)