#P8195. [传智杯 #4 决赛] 小智的疑惑
[传智杯 #4 决赛] 小智的疑惑
Problem Description
Chuanzhi Vocational College gave Xiaozhi a string that contains only lowercase letters. He wants to know how many times the substring chuanzhi appears in it.
We say a string is a substring of if and only if, after deleting some consecutive characters at the beginning of (possibly 0 characters) and some consecutive characters at the end of (possibly 0 characters), the remaining string is exactly the same as . For example, ab is a substring of abc, but ac is not a substring of abc.
Input Format
The input consists of one line containing a string .
Output Format
Output one line with one integer, representing the answer.
welcometochuanzhicupchuanzhi
2
Hint
Constraints
For all testdata, it is guaranteed that . Here, denotes the length of , and contains only lowercase letters.
Translated by ChatGPT 5