#246. 统计子串"xx"出现次数

    ID: 246 Type: Default 1000ms 256MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>codingbatWarmup-2gesp3字符串模拟

统计子串"xx"出现次数

Count 'xx' Substrings

Background

Congcong is currently learning about string processing. He encountered an interesting problem that requires counting the occurrences of a specific substring within a given string.

Problem Description

Count the number of "xx" in the given string. Overlapping is allowed, so "xxx" contains 2 "xx".

Input Format

Input is given from standard input in the following format.

A string SS.

Output Format

Output is printed to standard output in the following format.

An integer, representing the count of "xx".

Sample

abcxx
1
xxx
2
xxxx
3

Sample Explanation

For the input "xxx\