#include #include #include #include #include using namespace std; int main() { int n; string s; cin >> n >> s; int count = 0; for (int i = s.size() - 1; i >= 6; i--) { //cout << "Yo"; if(s.substr(i - 6, 7) == "CPCTCPC"){ s.replace(i - 6, 7, "CPCTF"); //cout << s << endl; } } for (int i = s.size() - 1; i >= 4; i--) { //cout << "Yo"; if(s.substr(i - 4, 5) == "CPCTF"){ count++; //cout << s << i << endl; } } cout << count; return 0; }