N = int(input()) C = list(map(int, input().split())) kyotaku = 30 print(sum([Ci <= sum(C)/10 for Ci in C])*kyotaku)