#define _USE_MATH_DEFINES #include //cin, cout #include //vector #include //sort,min,max,count #include //string #include //fixed #include //setprecision #include //swap #include //abs(int) #include //sqrt #include //stringstream,getline #include //ceil,M_PI using namespace std; int main() { string S; cin >> S; vector A(3); for (unsigned int i = 0; i < S.length(); i++) { switch (S[i]) { case 't': A[0]++; break; case 'r': A[1]++; break; case 'e': A[2]++; break; } } A[2] = A[2] / 2; int min = *min_element(A.begin(), A.end()); if (min != 0) { cout << min << endl; } else { cout << 0 << endl; } return 0; }