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