#include using namespace std; using ll = long long; using pll = pair; #define drep(i, cc, n) for (ll i = (cc); i <= (n); ++i) #define rep(i, n) drep(i, 0, n - 1) #define all(a) (a).begin(), (a).end() #define pb push_back #define fi first #define se second const ll MOD = 1000000007; const ll MOD2 = 998244353; const ll INF = 1LL << 60; const ll MAX_N = 2e5; int main(){ ll n; cin >> n; string s; cin >> s; vector> cnt(3, vector(3, 0)); rep(i, 3*n){ if(s[i]=='c') cnt[i%3][0]++; if(s[i]=='o') cnt[i%3][1]++; if(s[i]=='n') cnt[i%3][2]++; } ll ans = 0; ll rest = n; //con ans += min(cnt[0][0], min(cnt[1][1], cnt[2][2])); rest -= min(cnt[0][0], min(cnt[1][1], cnt[2][2])); //onc ll x = min(cnt[0][1], min(cnt[1][2], cnt[2][0])); if(x+1 < rest){ rest -= x+1; ans += x; }else{ ans += rest-1; rest = 0; cout << ans << endl; return 0; } //nco ll y = min(cnt[0][2], min(cnt[1][0], cnt[2][1])); if(y+1 < rest){ rest-=y+1; ans += y; }else{ ans += rest-1; rest = 0; } cout << ans << endl; }