#include #include #include using namespace std; int main(){ string s; cin >> s; int l = s.size(); int t = 0, r = 0, e = 0; for ( int i = 0; i < l; i++ ){ if ( s[i] == 't' ) t++ ; if ( s[i] == 'r' ) r++ ; if ( s[i] == 'e' ) e++ ; } cout << min( {t, r, e/2} ) << endl; return 0; }