i = 0 gets.chomp.scan(/[tree]/) do |m| i += 1 end p i/4