AtCoder Beginner Contest 150
B
Count ABC
AtCoder
未评级
原题
← AC →
翻译中…

Problem Statement

翻译中…

We have a string $S$ of length $N$ consisting of uppercase English letters.

翻译中…

How many times does ABC occur in $S$ as contiguous subsequences (see Sample Inputs and Outputs)?

翻译中…

Constraints

翻译中…
  • $3 \leq N \leq 50$
  • $S$ consists of uppercase English letters.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N
S

翻译中…

Output

翻译中…

Print number of occurrences of ABC in $S$ as contiguous subsequences.

翻译中…

样例

Input #1
10
ZABCDBABCQ
Output #1
2
Two contiguous subsequences of $S$ are equal to `ABC`: the $2$-nd through $4$-th characters, and the $7$-th through $9$-th characters.
Input #2
19
THREEONEFOURONEFIVE
Output #2
0
No contiguous subsequences of $S$ are equal to `ABC`.
Input #3
33
ABCCABCBABCCABACBCBBABCBCBCBCABCB
Output #3
5
题目信息
题号
abc150_b
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。