N=int(input()) A=list(map(int,input().split())) T=sum(A) N=T/10 ANS=[] for x in A: if x<=N:ANS.append(30) print(sum(ANS))