N = int(input())
C = list(map(int, input().split()))
s = sum(C) / 10
c = 0
for n in C:
	if n <= s:
		c += 1
print(c * 30)