input();a=[*map(int,input().split())] print(30*sum((sum(a)//10)>=i for i in a))