P27360 [AtCoder] PASTal Code
普及+
题目描述

Problem Description

Takahashi has input a string $ S $ that satisfies the following conditions:

  • $ S $ is a concatenation of one or more occurrences of past or post.
  • Among the concatenated strings, at most one is post.

Your task is to determine the position of post among the concatenated strings.

Input Format

The input is given from the standard input in the following format:

$ S $

Output Format

If post is concatenated exactly once, output a single positive integer indicating its position from the beginning. If post is not concatenated at all, output none.

Sample Input and Output

Sample Input #1

pastpastpostpast

Sample Output #1

3

Sample Input #2

pastpastpast

Sample Output #2

none

Notes/Hints

Constraints

  • $|S| \le 1000$
  • $ S $ is a concatenation of one or more occurrences of past or post.
  • Among the concatenated strings, at most one is post.

Sample Explanation 1

$ S = $ pastpastpostpast. The third concatenated string is post.

Sample Explanation 2

$ S = $ pastpastpast. No post is concatenated.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
pastpastpostpast
样例输出
3