100 atcoder#ABC150B. [ABC150B] Count ABC
[ABC150B] Count ABC
Score : points
Problem Statement
We have a string of length consisting of uppercase English letters.
How many times does ABC
occur in as contiguous subsequences (see Sample Inputs and Outputs)?
Constraints
- consists of uppercase English letters.
Input
Input is given from Standard Input in the following format:
Output
Print number of occurrences of ABC
in as contiguous subsequences.
10
ZABCDBABCQ
2
Two contiguous subsequences of are equal to ABC
: the -nd through -th characters, and the -th through -th characters.
19
THREEONEFOURONEFIVE
0
No contiguous subsequences of are equal to ABC
.
33
ABCCABCBABCCABACBCBBABCBCBCBCABCB
5