n=input() c=list(map(int,input().split()));b=sum(c)//10 print(len([_ for _ in c if b>=_]) * 30)