n = int(input()) votes = list(map(int,input().split())) cnt=0 for i in votes: if i <= sum(votes)//10: cnt+=1 print(cnt * 30)