{"problem":{"name":"Digit Sum 2","description":{"content":"Find the maximum possible sum of the digits (in base $10$) of a positive integer not greater than $N$.","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"agc021_a"},"statements":[{"statement_type":"Markdown","content":"Find the maximum possible sum of the digits (in base $10$) of a positive integer not greater than $N$.\n\n## Constraints\n\n*   $1\\leq N \\leq 10^{16}$\n*   $N$ is an integer.\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":"agc021_a","tags":[],"sample_group":[["100","18\n\nFor example, the sum of the digits in $99$ is $18$, which turns out to be the maximum value."],["9995","35\n\nFor example, the sum of the digits in $9989$ is $35$, which turns out to be the maximum value."],["3141592653589793","137"]],"created_at":"2026-03-03 11:01:13"}}