{"problem":{"name":"log","description":{"content":"Snuke is visiting a shop in Tokyo called 109 to buy some logs. He wants $n$ logs: one of length $1$, one of length $2$, $...$, and one of length $n$. The shop has $n+1$ logs in stock: one of length $1","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc109_b"},"statements":[{"statement_type":"Markdown","content":"Snuke is visiting a shop in Tokyo called 109 to buy some logs. He wants $n$ logs: one of length $1$, one of length $2$, $...$, and one of length $n$. The shop has $n+1$ logs in stock: one of length $1$, one of length $2$, $\\dots$, and one of length $n+1$. Each of these logs is sold for $1$ yen (the currency of Japan).\nHe can cut these logs as many times as he wants after buying them. That is, he can get $k$ logs of length $L_1, \\dots, L_k$ from a log of length $L$, where $L = L_1 + \\dots + L_k$. He can also throw away unwanted logs.\nSnuke wants to spend as little money as possible to get the logs he wants. Find the minimum amount of money needed to get $n$ logs of length $1$ to $n$.\n\n## Constraints\n\n*   $1 \\leq n \\leq 10^{18}$\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$n$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc109_b","tags":[],"sample_group":[["4","3\n\nOne way to get the logs he wants with $3$ yen is:\n\n*   Buy logs of length $2$, $4$, and $5$.\n*   Cut the log of length $5$ into two logs of length $1$ each and a log of length $3$.\n*   Throw away one of the logs of length $1$."],["109109109109109109","109109108641970782"]],"created_at":"2026-03-03 11:01:13"}}