{"problem":{"name":"Poisonous Cookies","description":{"content":"Takahashi has $A$ untasty cookies containing antidotes, $B$ tasty cookies containing antidotes and $C$ tasty cookies containing poison. Eating a cookie containing poison results in a stomachache, and ","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"agc030_a"},"statements":[{"statement_type":"Markdown","content":"Takahashi has $A$ untasty cookies containing antidotes, $B$ tasty cookies containing antidotes and $C$ tasty cookies containing poison.\nEating a cookie containing poison results in a stomachache, and eating a cookie containing poison while having a stomachache results in a death. As he wants to live, he cannot eat one in such a situation. Eating a cookie containing antidotes while having a stomachache cures it, and there is no other way to cure stomachaches.\nFind the maximum number of tasty cookies that Takahashi can eat.\n\n## Constraints\n\n*   $0 \\leq A,B,C \\leq 10^9$\n*   $A,B$ and $C$ are integers.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$A$ $B$ $C$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"agc030_a","tags":[],"sample_group":[["3 1 4","5\n\nWe can eat all tasty cookies, in the following order:\n\n*   A tasty cookie containing poison\n*   An untasty cookie containing antidotes\n*   A tasty cookie containing poison\n*   A tasty cookie containing antidotes\n*   A tasty cookie containing poison\n*   An untasty cookie containing antidotes\n*   A tasty cookie containing poison"],["5 2 9","10"],["8 8 1","9"]],"created_at":"2026-03-03 11:01:14"}}