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