#借助count()实现
n,x = map(int,input().split())
ls = ''.join([str(i) for i in range(1,n+1)])
print(ls.count(str(x)))