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