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