n = input() s = input() print(s.replace("CPCTCPC", "CPCTF").count("CPCTF"))