n=int(input());d=0 c=[*map(int,input().split())] for i in range(n): if c[i]<=0.1*sum(c): d+=1 print(30*d)