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