#include #include using namespace std; int main() { int N; cin >> N; string S; cin >> S; int i = 3; int cnt = 0; while (i < N - 1) { char c = S[i]; if (c != 'T') { i++; continue; } if (S.substr(i - 3, 3) == "CPC") { if (S[i + 1] == 'F') { cnt++; i += 5; } else if (i + 3 < N && S.substr(i + 1, 3) == "CPC") { cnt++; i += 7; } else { continue; } } else { i += 4; } } cout << cnt << endl; return 0; }