N=int(input()) C=list(map(int,input().split())) SUM=sum(C) ANS=0 for c in C: if c<=SUM//10: ANS+=30 print(ANS)