{"problem":{"name":"First ABC 2","description":{"content":"You are given a string $S$ of length $N$ consisting of `A`, `B`, and `C`.   Find the position where `ABC` first appears as a (contiguous) substring in $S$. In other words, find the smallest integer $n","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc322_a"},"statements":[{"statement_type":"Markdown","content":"You are given a string $S$ of length $N$ consisting of `A`, `B`, and `C`.  \nFind the position where `ABC` first appears as a (contiguous) substring in $S$. In other words, find the smallest integer $n$ that satisfies all of the following conditions.\n\n*   $1 \\leq n \\leq N - 2$.\n*   The string obtained by extracting the $n$\\-th through $(n+2)$\\-th characters of $S$ is `ABC`.\n\nIf `ABC` does not appear in $S$, print `-1`.\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\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":"abc322_a","tags":[],"sample_group":[["8\nABABCABC","3\n\n`ABC` first appears in $S$ at the $3$\\-rd through $5$\\-th characters of $S$. Therefore, the answer is $3$."],["3\nACB","\\-1\n\nIf `ABC` does not appear in $S$, print $-1$."],["20\nBBAAABBACAACABCBABAB","13"]],"created_at":"2026-03-03 11:01:14"}}