33OJ
登录 注册

#P17864. [FJCPC 2026] 贝贝拯救FJCPC

    ID: 20611 远端评测题 1000ms 256MiB 尝试: 0 已通过: 0 显示难度入门 上传者: 标签>模拟字符串福建2026省赛/邀请赛

[FJCPC 2026] 贝贝拯救FJCPC

Background

:::align{center} :::

Problem Description

FJCPC (Fujian Provincial Collegiate Programming Contest) is not only the highest-level collegiate programming contest in Fujian Province, but also a national invitational contest of CCPC (China Collegiate Programming Contest).

To attract outstanding contestants from all over the country, Beibei, as the publicity officer of the contest, has prepared a large number of slogans. During the generation of the slogans, the system randomly generates a very long base string and tries many times to embed the contest identifier fjcpc into it. Since the embedding positions are completely random, some positions may be overwritten repeatedly.

Given a string SS consisting of lowercase letters, please count how many times the complete substring fjcpc occurs in this string.

Input Format

The input consists of a single line, containing a string SS of length n(n≤105)n (n \leq 10^5), consisting only of lowercase letters.

Output Format

Output a single integer, the number of occurrences of the substring fjcpc in the string SS.

beibeilovesfjcpc
1
fjfjcpccpcfjcpc
2

Hint

Note: a substring must be contiguous. For example, in fjfjcpc, fjcpc occurs once.

Translated by QwenWork