#include "bits/stdc++.h" #ifndef err #define err(...) #define DebugWriteLine(...) #endif using namespace std; void Calc(); #define ALL(win) begin(win),end(win) #define RALL(win) (win).rbegin(),(win).rend() typedef int64_t ll; typedef uint64_t ull; int main() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(15); cin.exceptions(istream::failbit | istream::badbit); Calc(); cout.flush(); return 0; } template struct Iter { T&operator++() { return ++i; } constexpr const T&operator*() const { return i; } constexpr bool operator!=(const Iter &o) const { return i != o.i; } T i; }; struct Scanner { templatestatic A Next() { A a; cin >> a; return a; } templatestatic vector Array(int n) { vector a(n); for (A&i : a) cin >> i; return a; } static string Line() { string s; getline(cin, s); return s; } static int Int() { return Next(); } templateScanner&operator,(A&a) { a = Next(); return *this; } templateoperator A() { return Next(); } }in; /*---------------------------------------------------------------------*/ void Calc() { string s = in; map m; string tree = "tree"; for (auto& i : s) { m[i]++; } m['e'] /= 2; int cnt = INT_MAX; for (auto& i : tree) { cnt = min(cnt, m[i]); } cout << cnt << endl; }