#include #include #include using namespace std; int main() { string S; cin >> S; map m; for (int i = 0; i < S.size(); i++) { if (S[i] == 't' || S[i] == 'r' || S[i] == 'e') { if (m.find(S[i]) != m.end()) m[S[i]] += 1; else m[S[i]] = 1; } } cout << min(min(m['t'], m['r']), m['e'] / 2) << endl; return 0; }