n=int(input()) a=list(map(int,input().split())) A=sum(a) print(sum(v<=A//10 for v in a)*30)