#include int main(){ long int t = 0; long int r = 0; long int e = 0; int c = 0; int count = 0; while ((c = getchar()) != EOF) { /* 文字の入力 */ if (c == 't') t++; if (c == 'r') r++; if (c == 'e') e++; } while(t >= 1 && r >= 1 && e >= 2){ count++; t--; r--; e-=2; } printf("%d", count); return 0; }