Codeforces Round 230 (Div. 2)
A
Nineteen
Codeforces
未评级
原题
←B →
翻译中…

Alice likes word "nineteen" very much. She has a string $*s*$ and wants the string to contain as many such words as possible. For that reason she can rearrange the letters of the string.

翻译中…

For example, if she has string "xiineteenppnnnewtnee", she can get string "xnineteenppnineteenw", containing (the occurrences marked) two such words. More formally, word "nineteen" occurs in the string the number of times you can read it starting from some letter of the string. Of course, you shouldn't skip letters.

翻译中…

Help her to find the maximum number of "nineteen"s that she can get in her string.

翻译中…

Input

翻译中…

The first line contains a non-empty string $*s*$, consisting only of lowercase English letters. The length of string $*s*$ doesn't exceed 100.

翻译中…

Output

翻译中…

Print a single integer — the maximum number of "nineteen"s that she can get in her string.

翻译中…

样例

Input #1
nniinneetteeeenn
Output #1
2
InputCopy OutputCopy
Input #2
nneteenabcnneteenabcnneteenabcnneteenabcnneteenabcii
Output #2
2
InputCopy OutputCopy
Input #3
nineteenineteen
Output #3
2
InputCopy OutputCopy
题目信息
题号
393A
时间限制
1 s
内存限制
256 MB

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。