#include using namespace std; using ll = long long; constexpr int INF = (1u << 31) - 1; int main() { int N; string S; cin >> N >> S; // CPCTとなっている状態 string n; for (int i = 0; i < N; i++) { if (i + 3 < N && S[i] == 'C' && S[i + 1] == 'P' && S[i + 2] == 'C' && S[i + 3] == 'T') { if (i + 6 < N && S[i + 4] == 'C' && S[i + 5] == 'P' && S[i + 6] == 'C') { n += "CPCTF"; i += 7; continue; } } n.push_back(S[i]); } ll ans{}; for (int i = 0; i + 4 < N; i++) { if (n.substr(i, 5) == "CPCTF") ans++; // cout << n.substr(i, 5) << endl; } cout << ans << endl; }