#include using namespace std; #include using namespace atcoder; #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define rep1(i, n) for (int i = 1; i < (int)(n+1); i++) #define repn(i,a,b) for (int i = (int)(a) ; i < (int)(b+1); i++) #define repv(i, n) for (int i = (int)(n-1); i >= 0; i--) #define all(x) (x).begin(),(x).end() #define rall(x) (x).rbegin(),(x).rend() #define sz(x) ((int)(x).size()) #define cauto const auto& #define bit(n) (1LL<<(n)) #define uni(v) v.erase( unique(v.begin(), v.end()), v.end() ); using ll = long long; using P = pair; using PP = pair; using Graph = vector>; using mint = modint998244353; #ifdef LOCAL #include #define debug(...) debug::multi_print(#__VA_ARGS__, __VA_ARGS__) #else #define debug(...) (static_cast(0)) #endif int main(){ int n; cin >> n; string s; cin >> s; int c_1 = 0, c_2 = 0, c_3 = 0, o_1 = 0, o_2 = 0, o_3 = 0, n_1 = 0, n_2 = 0, n_3 = 0; rep(i,sz(s)){ if(i%3==0){ if(s[i]=='c') c_1++; else if(s[i]=='o') o_1++; else if(s[i]=='n') n_1++; } else if(i%3==1){ if(s[i]=='c') c_2++; else if(s[i]=='o') o_2++; else if(s[i]=='n') n_2++; } else{ if(s[i]=='c') c_3++; else if(s[i]=='o') o_3++; else if(s[i]=='n') n_3++; } } debug(c_1, c_2, c_3); debug(o_1, o_2, o_3); debug(n_1, n_2, n_3); int ans1 = 1e9; ans1 = min(ans1, c_1); ans1 = min(ans1, o_2); ans1 = min(ans1, n_3); int ans2 = 1e9; ans2 = min(ans2, c_2); ans2 = min(ans2, o_3); ans2 = min(ans2, n_1); int ans3 = 1e9; ans3 = min(ans3, c_3); ans3 = min(ans3, o_1); ans3 = min(ans3, n_2); ans1 = min(ans1, n); ans2 = min(ans2, n-ans1); ans3 = min(ans3, n-ans1-ans2); int ans = 0; ans += ans1; ans += ans2; ans += ans3; cout << ans << endl; return 0; }