using System; using static System.Console; using System.Linq; using System.Collections.Generic; class Program { static int NN => int.Parse(ReadLine()); static int[] NList => ReadLine().Split().Select(int.Parse).ToArray(); static string[] SList(long n) => Enumerable.Repeat(0, (int)n).Select(_ => ReadLine()).ToArray(); public static void Main() { Solve(); } static void Solve() { var n = NN; var s = ReadLine(); WriteLine(CPC(n, s)); } static int CPC(int n, string s) { var pos = 0; var ans = 0; while(pos < n) { if (pos + 5 <= n && s[pos..(pos+5)] == "CPCTF") { ++ans; pos += 5; } else if (pos + 7 <= n && s[pos..(pos+7)] == "CPCTCPC") { ++ans; pos += 7; } else ++pos; } return ans; } }