N = int(input())
C = list(map(int, input().split()))

th = sum(C)/10
ans = 0
for i in C:
	if(i <= th) :
		ans += 30

print(ans)