#include "bits/stdc++.h" #define MOD 1000000007 #define INF 11234567890 #define in std::cin #define out std::cout #define rep(i,N) for(LL i=0;i> S; for (auto c : S) { if (c == 't') { ++t; } if (c == 'r') { ++r; } if (c == 'e') { ++e; } } e /= 2; out << std::min(t, std::min(r, e)) << std::endl; return 0; }