N=int(input())
C=list(map(int,input().split()))
count=0
for i in range(N):
    if C[i]<=(sum(C)/10):
        count+=1
print(count*30)