#B3663. Counting Occurrences of Substring 'luogu'

    ID: 11322 Type: Default 1000ms 256MiB

Counting Occurrences of Substring 'luogu'

Counting Occurrences of Substring 'luogu'

Given a string S consisting of lowercase English letters, count the number of times the substring luogu appears in S.

Hint: A substring is any contiguous sequence of characters in the string.

For example, the string abc contains 7 substrings: the empty string, a, ab, abc, b, bc, and c. Note that ac is not a substring of abc.

inputFormat

The input consists of a single line containing the string S.

outputFormat

Output a single integer indicating the number of times the substring luogu appears in S.

sample

luogu
1