{"raw_statement":[{"iden":"problem statement","content":"For how many positive integers at most $N$ is the product of the digits at most $K$?"},{"iden":"constraints","content":"*   $1 \\leq N \\leq 10^{18}$\n*   $1 \\leq K \\leq 10^9$\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":"13 2"},{"iden":"sample output 1","content":"5\n\nOut of the positive integers at most $13$, there are five such that the product of the digits is at most $2$: $1$, $2$, $10$, $11$, and $12$."},{"iden":"sample input 2","content":"100 80"},{"iden":"sample output 2","content":"99\n\nOut of the positive integers at most $100$, all but $99$ satisfy the condition."},{"iden":"sample input 3","content":"1000000000000000000 1000000000"},{"iden":"sample output 3","content":"841103275147365677\n\nNote that the answer may not fit into a $32$\\-bit integer."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}