{"raw_statement":[{"iden":"problem statement","content":"Caracal is fighting with a monster.\nThe _health_ of the monster is $H$.\nCaracal can attack by choosing one monster. When a monster is attacked, depending on that monster's health, the following happens:\n\n*   If the monster's health is $1$, it drops to $0$.\n*   If the monster's health, $X$, is greater than $1$, that monster disappears. Then, two new monsters appear, each with the health of $\\lfloor X/2 \\rfloor$.\n\n($\\lfloor r \\rfloor$ denotes the greatest integer not exceeding $r$.)\nCaracal wins when the healths of all existing monsters become $0$ or below.\nFind the minimum number of attacks Caracal needs to make before winning."},{"iden":"constraints","content":"*   $1 \\leq H \\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$H$"},{"iden":"sample input 1","content":"2"},{"iden":"sample output 1","content":"3\n\nWhen Caracal attacks the initial monster, it disappears, and two monsters appear, each with the health of $1$.\nThen, Caracal can attack each of these new monsters once and win with a total of three attacks."},{"iden":"sample input 2","content":"4"},{"iden":"sample output 2","content":"7"},{"iden":"sample input 3","content":"1000000000000"},{"iden":"sample output 3","content":"1099511627775"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}