{"raw_statement":[{"iden":"problem statement","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."},{"iden":"constraints","content":"*   $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`."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$\n$S$"},{"iden":"sample input 1","content":"5\nACABB"},{"iden":"sample output 1","content":"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$."},{"iden":"sample input 2","content":"4\nCABC"},{"iden":"sample output 2","content":"3\n\nIn the first three characters from the left, each of `A`, `B`, and `C` appears once, satisfying the condition."},{"iden":"sample input 3","content":"30\nAABABBBABABBABABCABACAABCBACCA"},{"iden":"sample output 3","content":"17"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}