n = int(input()) S = input() cnt = [[0] * 3 for _ in range(3)] for i, s in enumerate(S): if s == "c": cnt[i % 3][0] += 1 elif s == "o": cnt[i % 3][1] += 1 elif s == "n": cnt[i % 3][2] += 1 ans = 0 for i in range(3): mi = 1 << 30 for j in range(3): mi = min(mi, cnt[(i + j) % 3][j]) ans += mi print(ans)