#include #include #include #include using namespace std; #define REP(i,a,b) for(i=a;i> s[i];i++) { if(s[i] == 't') t++; else if(s[i] == 'r') r++; else if(s[i] == 'e') e++; } cout << min(t,min(r,e/2)) << endl; return 0; }