import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int n = sc.nextInt(); char[] inputs = sc.next().toCharArray(); int[] cCounts = new int[3]; int[] oCounts = new int[3]; int[] nCounts = new int[3]; for (int i = 0; i < n * 3; i++) { if (inputs[i] == 'c') { cCounts[i % 3]++; } else if (inputs[i] == 'o') { oCounts[i % 3]++; } else if (inputs[i] == 'n') { nCounts[i % 3]++; } } int ans = 0; int[] counts = new int[3]; for (int i = 0; i < 3; i++) { counts[i] = Math.min(cCounts[i], Math.min(oCounts[(i + 1) % 3], nCounts[(i + 2) % 3])); ans += counts[i]; } if (ans == n) { if (counts[0] != n) { ans--; } } System.out.println(ans); } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); StringBuilder sb = new StringBuilder(); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public double nextDouble() throws Exception { return Double.parseDouble(next()); } public String next() throws Exception { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }