#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define Would #define you const int INF = 999999999; const int MOD = 1e9 + 7; int t, r, e; int main() { string h; cin >> h; for (int i = 0; i < h.length(); ++i) { if (h[i] == 't') { ++t; } else if (h[i] == 'r') { ++r; } else if (h[i] == 'e') { ++e; } } cout << min({ t,r,e / 2 }) << endl; }