N = int(input()) S = input() S = S.replace("CPCTCPC", "CPCTF") print(S.count("CPCTF"))