#include using namespace std; #define lp(i, a, b) for (int i = (int)(a); i < (int)(b); i++) #define rep(i, n) lp(i, 0, n) #define rlp(i, a, b) for (int i = (int)(b) - 1; i >= (int)(a); i--) #define rrep(i, n) rlp(i, 0, n) #define mp make_pair #define mt make_tuple #define pb push_back #define eb emplace_back #define all(c) begin(c), end(c) typedef long long ll; typedef unsigned long long ull; template inline void unique(T &c){ sort(all(c)); c.erase(unique(all(c)), end(c)); } int cnt[256]; int main() { string s; cin >> s; for (auto c : s) cnt[c]++; cout << min({cnt['t'], cnt['r'], cnt['e'] / 2}) << endl; }