#include #include #include using namespace std; int a[3]; int main() { string s; int ans = 1000000; cin >> s; for (auto& e : s) { if (e == 't') a[0]++; else if (e == 'r') a[1]++; else if (e == 'e') a[2]++; } a[2] /= 2; for (auto& e : a) { ans = (ans, e); } cout << ans << endl; }