#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define INF (1 << 30) #define INFLL (1LL << 60) int main() { string str; int t = 0,r = 0,e = 0; cin >> str; for(int i = 0;i < str.size();i++){ if(str[i] == 't') t++; if(str[i] == 'r') r++; if(str[i] == 'e') e++; } e = e/2; cout << min(t,min(r,e)) << endl; return 0; }