{"raw_statement":[{"iden":"problem statement","content":"There is a single integer $N$ written on a blackboard.  \nTakahashi will repeat the following series of operations until all integers not less than $2$ are removed from the blackboard:\n\n*   Choose one integer $x$ not less than $2$ written on the blackboard.\n*   Erase one occurrence of $x$ from the blackboard. Then, write two new integers $\\left \\lfloor \\dfrac{x}{2} \\right\\rfloor$ and $\\left\\lceil \\dfrac{x}{2} \\right\\rceil$ on the blackboard.\n*   Takahashi must pay $x$ yen to perform this series of operations.\n\nHere, $\\lfloor a \\rfloor$ denotes the largest integer not greater than $a$, and $\\lceil a \\rceil$ denotes the smallest integer not less than $a$.\nWhat is the total amount of money Takahashi will have paid when no more operations can be performed?  \nIt can be proved that the total amount he will pay is constant regardless of the order in which the operations are performed."},{"iden":"constraints","content":"*   $2 \\leq N \\leq 10^{17}$"},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$"},{"iden":"sample input 1","content":"3"},{"iden":"sample output 1","content":"5\n\nHere is an example of how Takahashi performs the operations:\n\n*   Initially, there is one $3$ written on the blackboard.\n*   He chooses $3$. He pays $3$ yen, erases one $3$ from the blackboard, and writes $\\left \\lfloor \\dfrac{3}{2} \\right\\rfloor = 1$ and $\\left\\lceil \\dfrac{3}{2} \\right\\rceil = 2$ on the blackboard.\n*   There is one $2$ and one $1$ written on the blackboard.\n*   He chooses $2$. He pays $2$ yen, erases one $2$ from the blackboard, and writes $\\left \\lfloor \\dfrac{2}{2} \\right\\rfloor = 1$ and $\\left\\lceil \\dfrac{2}{2} \\right\\rceil = 1$ on the blackboard.\n*   There are three $1$s written on the blackboard.\n*   Since all integers not less than $2$ have been removed from the blackboard, the process is finished.\n\nTakahashi has paid a total of $3 + 2 = 5$ yen for the entire process, so print $5$."},{"iden":"sample input 2","content":"340"},{"iden":"sample output 2","content":"2888"},{"iden":"sample input 3","content":"100000000000000000"},{"iden":"sample output 3","content":"5655884811924144128"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}