Problem2211--ABC150B - Count ABC

2211: ABC150B - Count ABC

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

Problem Statement

We have a string SS of length NN consisting of uppercase English letters.
How many times does ABC occur in SS as contiguous subsequences (see Sample Inputs and Outputs)?

Constraints

  • 3 \leq N \leq 503N50
  • SS consists of uppercase English letters.

Input

Input is given from Standard Input in the following format:
NNSS

Output

Print number of occurrences of ABC in SS as contiguous subsequences.

Sample Input Copy

10
ZABCDBABCQ

Sample Output Copy

2

HINT

Two contiguous subsequences of SS are equal to ABC: the 22-nd through 44-th characters, and the 77-th through 99-th characters.

Source/Category