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