{"problem":{"name":"Shorten ARC","description":{"content":"You are given a string $S$ of length $N$ consisting of `A`,`R`,`C`. As long as $S$ contains three consecutive characters that are `ARC`, you can perform the operation below. *   In an odd-numbered ($","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc140_b"},"statements":[{"statement_type":"Markdown","content":"You are given a string $S$ of length $N$ consisting of `A`,`R`,`C`.\nAs long as $S$ contains three consecutive characters that are `ARC`, you can perform the operation below.\n\n*   In an odd-numbered ($1$\\-st, $3$\\-rd, $5$\\-th, ...) operation, choose in $S$ three consecutive characters that are `ARC`, and replace them with `R`.\n*   In an even-numbered ($2$\\-nd, $4$\\-th, $6$\\-th, ...) operation, choose in $S$ three consecutive characters that are `ARC`, and replace them with `AC`.\n\nFind the maximum number of operations that can be performed.\n\n## Constraints\n\n*   $1 \\leq N \\leq 2\\times 10^5$\n*   $S$ is a string of length $N$ consisting of `A`,`R`,`C`.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n$S$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc140_b","tags":[],"sample_group":[["6\nAARCCC","2\n\nYou can perform two operations as follows.\n`AARCCC` → `ARCC` → `ACC`"],["5\nAAAAA","0\n\n$S$ does not contain three consecutive characters that are `ARC`, so you cannot perform the operation at all."],["9\nARCARCARC","3"]],"created_at":"2026-03-03 11:01:13"}}