n=int(input()) c=list(map(int,input().split(" "))) sc=sum(c) res=0 for i in range(n): if c[i]<=(sc/10): res+=30 print(res)