input() A=map(int,input().split()) print(sum([30 for x in A if x<=sum(A)/10]))