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