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