#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; using ll = long long; using ld = long double; int main(){ cin.tie(0); ios::sync_with_stdio(0); struct con { int c=0, o=0, n=0; }; int N; string S; cin >> N >> S; con x[3]; rep(i,N)rep(j,3) { if(S[i * 3 + j] == 'c') x[j].c++; if(S[i * 3 + j] == 'o') x[j].o++; if(S[i * 3 + j] == 'n') x[j].n++; } int ans = 0; ans += min({x[0].c, x[1].o, x[2].n}); ans += min({x[1].c, x[2].o, x[0].n}); ans += min({x[2].c, x[0].o, x[1].n}); if(ans == N) { if(min({x[0].c, x[1].o, x[2].n}) != N) { ans--; } } cout << ans << endl; }