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