#include using namespace std; using ll = long long; using llu = long long unsigned; // メイン関数 int main() { int n; string s; cin >> n >> s; string t1 = "CPC"; string t2 = "CPCTF"; string t3 = "CPCTCPC"; int ret = 0; for (int i=0; i<=n-5; ++i) { if (t2 == s.substr(i, t2.size())) { ret++; i+=t2.size(); } if (t3 == s.substr(i, t3.size())) { ret++; i+=t3.size(); } } cout << ret << endl; return 0; }