n = int(input()) s = input().strip() group0 = s[0::3] group1 = s[1::3] group2 = s[2::3] c0 = group0.count('c') o0 = group0.count('o') n0 = group0.count('n') c1 = group1.count('c') o1 = group1.count('o') n1 = group1.count('n') c2 = group2.count('c') o2 = group2.count('o') n2 = group2.count('n') type1 = min(c0, o1, n2) type2 = min(c1, o2, n0) type3 = min(c2, o0, n1) print(type1 + type2 + type3)