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