#include using namespace std; #define debug(x) cerr << #x << " -> " << x << "\n" static const int INF = 1e9 + 7; static const double EPS = 1e-10; static const int dx[] = {0, 1, 0, -1, 1, 1, -1, -1}; static const int dy[] = {1, 0, -1, 0, 1, -1, 1, -1}; template ostream &operator<<(ostream &os, vector &v){ for(int i = 0; i < v.size(); i++){ if(i) os << " "; os << v[i]; } return os; } int main(){ ios::sync_with_stdio(false); cin.tie(0); string str; cin >> str; sort(str.begin(), str.end()); string tre = "tre"; int ans = INF; for(int i = 0; i < 3; i++){ ans = min(ans, (upper_bound(str.begin(), str.end(), tre[i]) - lower_bound(str.begin(), str.end(), tre[i])) / (1 + (i == 2))); } cout << ans << "\n"; return 0; }