n = int(input()) s = input().strip() from collections import defaultdict groups = { 0: {'c': 0, 'o': 0, 'n': 0}, 1: {'c': 0, 'o': 0, 'n': 0}, 2: {'c': 0, 'o': 0, 'n': 0} } for i in range(len(s)): mod = i % 3 c = s[i] if c in ['c', 'o', 'n']: groups[mod][c] += 1 c0, o0, n0 = groups[0]['c'], groups[0]['o'], groups[0]['n'] c1, o1, n1 = groups[1]['c'], groups[1]['o'], groups[1]['n'] c2, o2, n2 = groups[2]['c'], groups[2]['o'], groups[2]['n'] t1 = min(c0, o1, n2) t2 = min(c1, o2, n0) t3 = min(c2, o0, n1) total = t1 + t2 + t3 print(total)