#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { int i, j, k; string s; cin >> s; int t = 0, r = 0, e = 0; for (i = 0; i < s.length(); i++) { if (s[i] == 't') { t++; } else if (s[i] == 'r') { r++; } else if (s[i] == 'e') { e++; } } e /= 2; int minn = 99999999; if (t >= 1 && r >= 1 && e >= 1) { minn = min({ t,r,e }); cout << minn << endl; } else { cout << 0 << endl; } getchar(); getchar(); return 0; }