n=int(input()) s=list(input()) from _collections import defaultdict cnt=defaultdict(int) for i in range(3*n): cnt[i%3,s[i]]+=1 ans=0 for j in range(3): res=min(cnt[j,"c"],cnt[(j+1)%3,"o"],cnt[(j+2)%3,"n"]) ans+=res print(ans)