n = gets.to_i s = gets.chomp puts s.gsub("TCPC", "TF").scan("CPCTF").size