#include #include #include #include int main() { char str[1000001] = ""; int t = 0; int r = 0; int e = 0; int cnt = 0; scanf("%s", str); for (int i = 0; str[i] != '\0'; i++) { if (str[i] == 't') { t++; } else if (str[i] == 'r') { r++; } else if (str[i] == 'e') { e++; } } e /= 2; while (t > 0 && r > 0 && e > 0) { t--; r--; e--; cnt++; } printf("%d\n", cnt); return 0; }