n=int(input()) *c,=map(int,input().split()) s=sum(c) print(sum([1 for i in c if i*10<=s])*30)