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