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