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