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