#include #include #include using namespace std; using ll = long long; int main() { char s[1000001]; scanf("%s", s); ll tc = 0, rc = 0, ec = 0, total = 0; for (int i = 0; s[i] != 0; i++) { if (s[i] == 't') { tc++; } else if (s[i] == 'r') { rc++; } else if (s[i] == 'e') { ec++; } } total = min(min(tc, rc), ec / 2); printf("%lld\n", total); }