ans=0 n=int(input()) lst=list(map(int,input().split())) sum_a=sum(lst)*.1 for i in range(n): if sum_a>=lst[i]:ans+=30 print(ans)