1236 - Sort The Number

Time Limit : 1 Second

Memory Limit : 128 MB

Submission: 207

Solved: 35

Description
Given two integer N, M, can you tell me how many numbers are lexicographically less than M among the numbers from 1 to N(inclusive) ?
eg. 23 is lexicographically less than 25, while 10 is lexicographically less than 2.
Input
There are multi-cases, each case per line with two integer N, M ( 1<=N, M<=1000000000)
Output
For each case output an integer representing the total numbers satisfying the condition in the description.
sample input
3 4
10 11
1  1
sample output
3
2
0
hint
source
© 2015 HUST ACMICPC TEAM. All Right Reserved.