Happy 2009

Time Limit: 1000ms
Memory Limit: 32768KB
This problem will be judged on HDU. Original ID: 2617
64-bit integer IO format: %I64d      Java class name: Main

Description

No matter you know me or not. Bless you happy in 2009.

Input

The input contains multiple test cases.
Each test case included one string. There are made up of ‘a’-‘z’ or blank. The length of string will not large than 10000.

Output

For each test case tell me how many times “happy” can be constructed by using the string. Forbid to change the position of the characters in the string. The answer will small than 1000.

Sample Input

hopppayppy happy
happ acm y
hahappyppy

Sample Output

2
1
2

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .