#int(input()) #map(int, input().split()) #list(map(int, input().split())) N = int(input()) S = input() m = 3 * N a = ("c", "o", "n") c = [[0] * 3 for i in range(3)] for i in range(m): if S[i] in a: t = a.index(S[i]) c[i%3][t] += 1 ans = 0 for i in range(3): b = 1000000 for j in range(3): b = min(c[(i+j)%3][j], b) ans += b print(ans)