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