{"problem":{"name":"ABC","description":{"content":"You are given a string $s$ consisting of `A`, `B` and `C`. Snuke wants to perform the following operation on $s$ as many times as possible: *   Choose a contiguous substring of $s$ that reads `ABC` a","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"agc034_b"},"statements":[{"statement_type":"Markdown","content":"You are given a string $s$ consisting of `A`, `B` and `C`.\nSnuke wants to perform the following operation on $s$ as many times as possible:\n\n*   Choose a contiguous substring of $s$ that reads `ABC` and replace it with `BCA`.\n\nFind the maximum possible number of operations.\n\n## Constraints\n\n*   $1 \\leq |s| \\leq 200000$\n*   Each character of $s$ is `A`, `B` and `C`.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$s$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"agc034_b","tags":[],"sample_group":[["ABCABC","3\n\nYou can perform the operations three times as follows: `ABCABC` → `BCAABC` → `BCABCA` → `BCBCAA`. This is the maximum result."],["C","0"],["ABCACCBABCBCAABCB","6"]],"created_at":"2026-03-03 11:01:14"}}