#include #include #include using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 4000000000000000001 int main(){ int N; cin>>N; string S; cin>>S; string s = "con"; vector cnt(3,0); int ans = 0; rep(i,3){ vector c(3,0); rep(j,S.size()){ if(s[(i+j)%3]==S[j]){ c[(i+j)%3]++; } } cnt[(3-i)%3] = min({c[0],c[1],c[2]}); } vector t(3); rep(i,3)t[i] = i; do{ int cur = 0; int sum = 0; rep(i,3){ while(cur%3!=t[i])cur++; int cc = cnt[t[i]]; while(cc!=0 && cur<=3*N){ cur+=3; sum++; cc--; } } ans = max(ans,sum); } while(next_permutation(t.begin(),t.end())); cout<