#include #include using namespace std; int main() { int n; string s, t = ""; cin >> n; cin >> s; for(int i = 0; i < n; i++) { t += s[i]; if(t.size() >= 7 && t.substr(t.size() - 7, 7) == "CPCTCPC") { for(int j = 0; j < 3; j++) t.pop_back(); t += "F"; } } int ans = 0; for(int i = 0; i + 4 < t.size(); i++) { if(t.substr(i,5) == "CPCTF") ans++; } cout << ans << "\n"; }