#include using namespace std; int main() { int64_t N; string S; cin >> N >> S; vector c_num(3, 0), o_num(3, 0), n_num(3, 0); for (int64_t i = 0; i < 3 * N; i++) { if (S[i] == 'c') { c_num[i % 3]++; } else if (S[i] == 'o') { o_num[i % 3]++; } else if (S[i] == 'n') { n_num[i % 3]++; } } int64_t ans = 0; ans += min({ c_num[0], o_num[1], n_num[2] }); ans += min({ c_num[1], o_num[2], n_num[0] }); ans += min({ c_num[2], o_num[0], n_num[1] }); cout << ans << endl; }