#include int main(void){ int i; char S[1000001]; int n[4] = {}, min; scanf("%s", S); for(i = 0; S[i] != '\0'; i++){ if(S[i] == 't') n[0]++; if(S[i] == 'r') n[1]++; if(S[i] == 'e') n[2]++; } n[2] = n[2] / 2; min = n[0]; if(min > n[1]) min = n[1]; if(min > n[2]) min = n[2]; printf("%d\n", min); return 0; }