input() c,k=list(map(int,input().split())),0 for i in c: k+=0 if i>sum(c)//10 else 30 print(k)