#include #include #include #include #include using namespace std; int main() { int n; string s; cin >> n >> s; while (s.find("CPCTCPC") != string::npos){ s.replace(s.find("CPCTCPC"), 7, "CPCTF"); } int count = 0; for (int i = 0; i < s.size(); i++) { if(s.find("CPCTF") != string::npos){ count++; } } cout << count; //cout << s; return 0; }