#K35047. Maximizing 'fourteen' Occurrences

    ID: 25444 Type: Default 1000ms 256MiB

Maximizing 'fourteen' Occurrences

Maximizing 'fourteen' Occurrences

Given a string (t), your task is to determine the maximum number of times the word (\texttt{fourteen}) can be formed by removing some characters from (t). You do not need to rearrange the characters; simply remove the extra ones. The word (\texttt{fourteen}) consists of the letters: [ \begin{array}{c} f:1,\quad o:1,\quad u:1,\quad r:1,\quad t:1,\quad e:2,\quad n:1 \end{array} ] That is, one occurrence of (\texttt{fourteen}) requires one 'f', one 'o', one 'u', one 'r', one 't', two 'e's, and one 'n'. Your goal is to compute the maximum number of complete occurrences of (\texttt{fourteen}) available in (t) given these constraints.

inputFormat

Input is provided via standard input (stdin) as a single line containing the string (t). The string may contain any lowercase English letters.

outputFormat

Output a single integer to standard output (stdout) representing the maximum number of times the word (\texttt{fourteen}) can be formed from the given string.## sample

ffouortorteeneefourtteenn
2