{"raw_statement":[{"iden":"problem statement","content":"In problems on AtCoder, you are often asked to:\n\n> find the answer modulo $998244353$.\n\nHere, we have $998244353 = 119 \\times 2^{23} + 1$. Related to this, solve the following prolem:\n\n> You are given an integer $N$.  \n> Print the minimum possible value of $a + b + c$ for a triple of non-negative integers $(a, b, c)$ satisfying $N = a \\times 2^b + c$."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 10^{18}$\n*   $N$ is an integer."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$"},{"iden":"sample input 1","content":"998244353"},{"iden":"sample output 1","content":"143\n\nWe have $998244353 = 119 \\times 2^{23} + 1$, in other words, the triple $(a, b, c) = (119, 23, 1)$ satisfies $N = a \\times 2^{b} + c$.  \nThe value $a+b+c$ for this triple is $143$.  \nThere is no such triple where $a+b+c \\leq 142$, so $143$ is the correct output."},{"iden":"sample input 2","content":"1000000007"},{"iden":"sample output 2","content":"49483\n\nWe have $1000000007 = 30517 \\times 2^{15} + 18951$, in other words, the triple $(a, b, c) = (30517, 15, 18951)$ satisfies $N = a \\times 2^{b} + c$.  \nThe value $a+b+c$ for this triple is $49483$.  \nThere is no such triple where $a+b+c \\leq 49482$, so $49483$ is the correct output."},{"iden":"sample input 3","content":"1"},{"iden":"sample output 3","content":"1\n\nNote that we have $2^0 = 1$."},{"iden":"sample input 4","content":"998984374864432412"},{"iden":"sample output 4","content":"2003450165"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}