N = int(input())
S = input()

t = S.replace('CPCTCPC', 'CPCTF')
ans = t.count('CPCTF')
print(ans)