#include #include #include #include using namespace std; int main() { string s; cin >> s; int arr[3] = {0,0,0}; for(char it:s) { if(it == 't') arr[0]++; else if(it == 'r') arr[1]++; else if(it == 'e') arr[2]++; } arr[2] /= 2; cout << *min_element(begin(arr), end(arr)); return 0; }