input() print(input().replace('CPCTCPC', 'CPCTF').count("CPCTF"))