#include #include using namespace std; int main(){ string str; cin >> str; int count_t = 0, count_r = 0, count_e = 0; int ans = 0; for(int i = 0; i < str.size(); i++){ if(str[i] == 't') count_t++; if(str[i] == 'r') count_r++; if(str[i] == 'e') count_e++; } while(count_t > 0 and count_r > 0 and count_e > 1){ count_t--; count_r--; count_e -= 2; ans++; } cout << ans << endl; return 0; }