from re import findall input() print(len(findall('CPCT(F|CPC)', input())))