P27901 [洛谷] [Language Month Competition 202401] Genshin Player
普及-
题目描述

Problem Description

In the QQ group for setting questions for Luogu's Beginner Contest/Language Month Competition, the group nickname of the renowned Luogu administrator Blue Border Pencil Ball is "Genshin Player." This nickname signifies that Blue Border Pencil Ball has been deeply engrossed in playing Genshin Impact and has caused numerous issues in the Language Month Competition.

Now, Fusu has given you a string \( s \). She wants you to determine how many ways there are to extract two substrings \( s[l_1, r_1] \) and \( s[l_2, r_2] \) from \( s \), satisfying:

  • \( 1 \leq l_1 \leq r_1 \leq l_2 \leq r_2 \leq |s| \), where \( |s| \) denotes the length of the string \( s \).
  • \( s[l_1, r_1] \) represents the substring from the \( l_1 \)-th character to the \( r_1 \)-th character of \( s \), and \( s[l_1, r_1] = \text{Genshin} \).
  • \( s[l_2, r_2] \) represents the substring from the \( l_2 \)-th character to the \( r_2 \)-th character of \( s \), and \( s[l_2, r_2] = \text{player} \).

Two schemes are considered different if and only if at least one of \( l_1, r_1, l_2, r_2 \) is different in the two schemes.

Input Format

The input consists of a single line containing a string \( s \).

Output Format

Output a single integer representing the answer.

Sample Input and Output

Sample Input #1

Genshinplayerplayer

Sample Output #1

2

Sample Input #2

ExpectedIsAGenshinplayerWhoLikesToBeAGenshinplayer

Sample Output #2

3

Notes

Data Size and Constraints

  • For 30% of the data, it is guaranteed that \( |s| \leq 50 \).
  • For 60% of the data, it is guaranteed that \( |s| \leq 200 \).
  • For 100% of the data, it is guaranteed that \( 1 \leq |s| \leq 2000 \), and \( s \) contains only uppercase and lowercase English letters.
输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
Genshinplayerplayer
样例输出
2