//No.279 木の数え上げ #pragma GCC optimize("O3") #pragma GCC target("avx") #include #define rep(i ,n) for(int i=0;i<(int)(n);++i) using namespace std; signed main(){ string s; cin >> s; int cnt_t = 0; int cnt_r = 0; int cnt_e = 0; rep( i , s.size()){ if( s[i] == 't') ++cnt_t; else if( s[i] == 'r') ++cnt_r; else if( s[i] == 'e') ++cnt_e; } cnt_e /= 2; int ans = (int)10e9; ans = min( ans , cnt_t); ans = min( ans , cnt_r ); ans = min( ans , cnt_e ); cout << ans << endl; }