import java.util.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); char[] arr = sc.next().toCharArray(); int total = 0; int y = 0; int vwx = 0; int u = 0; int lmnopqrst = 0; int k = 0; int j = 0; int i = 0; int abcdefgh = 0; for (char c : arr) { if (c > 'y') { total++; } else if (c == 'y') { y++; } else if (c > 'u') { vwx++; } else if (c == 'u') { u++; } else if (c > 'k') { lmnopqrst++; } else if (c == 'k') { k++; } else if (c > 'i') { j++; } else if (c == 'i') { i++; } else { abcdefgh++; } } while (y > 0 && u > 0 && k > 0 && i > 0 && abcdefgh > 0) { y--; u--; k--; i--; abcdefgh--; total++; } while (y > 0 && u > 0 && k > 0 && i > 1) { y--; u--; k--; i -= 2; total++; } while (y > 0 && u > 0 && k > 0 && j > 0) { y--; u--; k--; j --; total++; } while (y > 0 && u > 0 && k > 1) { y--; u--; k -= 2; total++; } while (y > 0 && u > 0 && lmnopqrst > 0) { y--; u--; lmnopqrst--; total++; } while (y > 0 && u > 1) { y--; u -= 2; total++; } while (y > 0 && vwx > 0) { y--; vwx--; total++; } total += y / 2; System.out.println(total); } }