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