#include using namespace std; int main() { int n; string s; cin >> n >> s; string t = ""; int i = 0; while (i < n) { if (s[i] == 'C' && i + 6 < n && s.substr(i, 7) == "CPCTCPC") { t += "CPCTF"; i += 7; } else { t += s[i]; i++; } } int ans = 0; for (int i = 0; i <= (int)t.size() - 5; i++) { if (t.substr(i, 5) == "CPCTF") { ans++; } } cout << ans << endl; }