from collections import defaultdict n = int(input()) S = list(input()) C = [defaultdict(int) for _ in range(3)] for i in range(3 * n): C[i % 3][S[i]] += 1 ans = 0 for i in range(3): ans += min(C[i % 3]['c'], C[(i + 1) % 3]['o'], C[(i + 2) % 3]['n']) print(ans)