#include #include #include #include using namespace std; using ll = long long; int f(string const& s, char c) { return count(s.begin(), s.end(), c); } int main() { string s; cin >> s; cout << min(f(s, 't'), min(f(s, 'r'), f(s, 'e')/2)) << endl; }