input() s = list(map(int, input().split())) d = sum(s) / 10 a = 0 for ss in s: if ss <= d: a += 1 print(a * 30)