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