#include using namespace std; /////////////////// メイン /////////////////// int main () { //////////////////// 入力 //////////////////// string s; cin >> s; //////////////// 出力変数定義 //////////////// int result = 0; //////////////////// 処理 //////////////////// int t = 0; int r = 0; int e = 0; for (char c : s) { if (c=='t') t++; if (c=='r') r++; if (c=='e') e++; } result = min({t,r,e/2}); //////////////////// 出力 //////////////////// cout << result << endl; //////////////////// 終了 //////////////////// return 0; }