{"problem":{"name":"3 Letters","description":{"content":"A string, consisting of letters `A`, `B`, and `C`, is called **good**, if every two consecutive letters are different. For example, strings `ABABAB` and `ABC` are good, while `ABBA` and `AABBCC` aren'","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"agc052_e"},"statements":[{"statement_type":"Markdown","content":"A string, consisting of letters `A`, `B`, and `C`, is called **good**, if every two consecutive letters are different. For example, strings `ABABAB` and `ABC` are good, while `ABBA` and `AABBCC` aren't.\nYou are given two **good** strings $S$ and $T$ of length $N$. In one operation, you can choose any letter of $S$, and change it to another letter among `A`, `B`, and `C`, so that $S$ remains **good**.\nWhat's the smallest number of operations needed to transform $S$ into $T$? We can prove that it can always be done in a finite number of operations.\n\n## Constraints\n\n*   $1\\le N \\le 5\\cdot 10^5$\n*   $S$ is a **good** string of length $N$ consisting of `A`, `B`, and `C`\n*   $T$ is a **good** string of length $N$ consisting of `A`, `B`, and `C`\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n$S$\n$T$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"agc052_e","tags":[],"sample_group":[["4\nCABC\nCBAC","6\n\nHere is one possible sequence of operations of length $6$:\n`CABC` $\\to$ `BABC` $\\to$ `BCBC` $\\to$ `BCAC` $\\to$ `ACAC` $\\to$ `ABAC` $\\to$ `CBAC`\nIt can be shown that $6$ operations are necessary for this case."],["10\nABABABABAB\nBABABABABA","15"]],"created_at":"2026-03-03 11:01:14"}}