{"raw_statement":[{"iden":"problem statement","content":"For a positive integer $x$, let $f(x)$ be the answer to the question below.\n\n> The following operation on $x$ can be performed zero or more times.\n> \n> *   Let $x'$ be the integer obtained by reversing the decimal notation of $x$. Then, replace $x$ with $x'$. If $x$ now has one or more leading zeros, delete them so that it begins with a non-zero digit.\n> \n> For example, from $x=1420$, you get $x=241$ after one operation, $x=142$ after two operations, and $x=241$ after three operations.  \n> Find the minimum possible value of $x$ after operations.\n\nFind the number of integers $x$ such that $1 \\leq x \\leq N$ and $f(x)=K$."},{"iden":"constraints","content":"*   $1 \\leq N,K \\leq 10^{12}$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$ $K$"},{"iden":"sample input 1","content":"1420 142"},{"iden":"sample output 1","content":"3\n\nThree integers $x=142$, $241$, and $1420$ satisfy $1 \\leq x \\leq 1420$ and $f(x)=142$."},{"iden":"sample input 2","content":"1419 142"},{"iden":"sample output 2","content":"2"},{"iden":"sample input 3","content":"6 19"},{"iden":"sample output 3","content":"0"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}