{"raw_statement":[{"iden":"problem statement","content":"You are given a positive integer $N$. There is an empty set $S$, and you can perform the following operation any number of times:\n\n*   Choose any positive integer $x$. For each of $x$, $2x$, and $3x$, add it to $S$ if it is not already in $S$.\n\nFind the minimum number of operations required to satisfy ${1, 2, \\dots, N} \\subseteq S$."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 10^{9}$"},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$"},{"iden":"sample input 1","content":"7"},{"iden":"sample output 1","content":"4\n\nChoosing $1$, $2$, $5$, and $7$ yields $S = {1, 2, 3, 4, 5, 6, 7, 10, 14, 15, 21}$, which satisfies the condition. It is impossible to satisfy the condition with three or fewer operations."},{"iden":"sample input 2","content":"25"},{"iden":"sample output 2","content":"14"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}