#include int main(void){ // 入力された値 char str[10000000]; scanf("%s",str); // treをそれぞれカウント int count[3]; for(int i = 0;i < 10000000;i++){ if(str[i] == 't'){ count[0]++; }else if(str[i] == 'r'){ count[1]++; }else if(str[i] == 'e'){ count[2]++; } } // eは1単語に2文字使うので2で割る count[2] /= 2; // ソート(昇順) for(int i = 0;i < 3;i++){ for(int j = 0;j < 3;j++){ if(count[i] < count[j]){ int tmp = count[i]; count[i] = count[j]; count[j] = tmp; } } } printf("%d",count[0]); }