n = int(input()) c_lst = list( map( int, input() .split(' ') ) ) sum_vote = sum(c_lst) c_lst = sorted(c_lst) cnt = 0 for c in c_lst: if c <= sum_vote/10: cnt += 30 else: break print(cnt)