#include int main(void) { char c; int t, r, e, n; n = t = r = e = 0; while ((c = getchar()) != EOF) { if (c == '\n') { break; } switch (c) { case 't': t++; break; case 'r': r++; break; case 'e': e++; break; default: break; } if ((t > 0) && (r > 0) && (e > 1)) { t--; r--; e -= 2; n++; } } printf("%d\n", n); return 0; }