n=int(input()) l=list(map(int,input().split())) a=sum(l)/10 print(sum(map(lambda x:30 if x<=a else 0,l)))