#!/usr/bin/env python3 #fileencoding: utf-8 tree = {"t":0, "r":0, "e":0} for i in input(): if i == "t" or i == "e" or i == "r": tree[i] += 1 tree["e"] //= 2 print(min(tree.values()))