#P15927. [TOPC 2023] Kick

[TOPC 2023] Kick

题目描述

You are given a string ss consisting of lowercase English letters. A “kick” is defined as a substring of ss that starts with the letter ‘k’ followed by the letter ‘i’ followed by the letter ‘c’ followed by the letter ‘k’.

Your task is to count the number of distinct “kicks” in the string ss. Note that the kicks can overlap.

输入格式

The input contains exactly a string ss consisting of lowercase English letters.

输出格式

Print the number of “kicks” on a line.

kickickstartkicks
3
kickkickkickkick
4

提示

The length of the string ss is no more than 5×1065 \times 10^6.