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