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