#include #include using namespace std; int main() { int a=0, b=0, c=0, d=0; string str; cin >> str; for (int i = 0; i < str.length(); i++) { if (str[i] == 't') a++; if (str[i] == 'r') b++; if (str[i] == 'e') c++; if (a >= 1 && b >= 1 && c >= 2) { d++; a--; b--; c -= 2; } } cout << d << endl; return 0; }