N = input()
C = map(int,raw_input().split())
S = sum(C)
print sum(30 for i in range(N) if S >= 10*C[i])