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