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