#include #include using namespace std; int main(int argc, const char* argv[]) { string S; cin >> S; int t = count(S.begin(), S.end(), 't'); int r = count(S.begin(), S.end(), 'r'); int e = count(S.begin(), S.end(), 'e'); e /= 2; cout << min(t, min(r, e)) << endl; return 0; }