n=int(input()) s=input() s0=s[0::3] s1=s[1::3] s2=s[2::3] con=min(s0.count("c"),s1.count("o"),s2.count("n")) nco=min(s0.count("n"),s1.count("c"),s2.count("o")) onc=min(s0.count("o"),s1.count("n"),s2.count("c")) if con==n: print(n) else: print(min(con+nco+onc,n-1))