#include #define int long long using namespace std; using Graph = vector>; signed main(){ string S; cin >> S; int t = 0; int r = 0; int e = 0; for( int i = 0; i < S.size(); i++ ){ if( S.at(i) == 't' ) t++; else if( S.at(i) == 'r' ) r++; else if( S.at(i) == 'e' ) e++; } cout << min({t, r, e/2}) << endl; }