n=int(input()) s=input() s.replace("CPCTCPC","CPCTF") print(len(s.split("CPCTF"))-1)