{"problem":{"name":"First ABC","description":{"content":"You are given a string $S$ consisting of `A`, `B`, and `C`. $S$ is guaranteed to contain all of `A`, `B`, and `C`. If the characters of $S$ are checked one by one from the left, how many characters wi","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc311_a"},"statements":[{"statement_type":"Markdown","content":"You are given a string $S$ consisting of `A`, `B`, and `C`. $S$ is guaranteed to contain all of `A`, `B`, and `C`.\nIf the characters of $S$ are checked one by one from the left, how many characters will have been checked when the following condition is satisfied for the first time?\n\n*   All of `A`, `B`, and `C` have appeared at least once.\n\n## Constraints\n\n*   $3 \\leq N \\leq 100$\n*   $S$ is a string of length $N$ consisting of `A`, `B`, and `C`.\n*   $S$ contains all of `A`, `B`, and `C`.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$N$\n$S$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"abc311_a","tags":[],"sample_group":[["5\nACABB","4\n\nIn the first four characters from the left, `A`, `B`, and `C` appear twice, once, and once, respectively, satisfying the condition.  \nThe condition is not satisfied by checking three or fewer characters, so the answer is $4$."],["4\nCABC","3\n\nIn the first three characters from the left, each of `A`, `B`, and `C` appears once, satisfying the condition."],["30\nAABABBBABABBABABCABACAABCBACCA","17"]],"created_at":"2026-03-03 11:01:14"}}