/* -*- coding: utf-8 -*- * * 145.cc: No.145 yukiover - yukicoder */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; /* constant */ const int MAX_N = 100000; const int Y = 'y' - 'a'; const int U = 'u' - 'a'; const int K = 'k' - 'a'; const int I = 'i' - 'a'; /* typedef */ /* global variables */ int cs[26]; /* subroutines */ /* main */ int main() { int n; string s; cin >> n >> s; for (int i = 0; i < n; i++) cs[s[i] - 'a']++; int cnt = 0; // yukj for (int i = I + 1; i < K; i++) { int d = min(cs[Y], min(cs[U], min(cs[K], cs[i]))); cnt += d; cs[Y] -= d; cs[U] -= d; cs[K] -= d; cs[i] -= d; } // yukk int d = min(cs[Y], min(cs[U], cs[K] / 2)); cnt += d; cs[Y] -= d; cs[U] -= d; cs[K] -= d * 2; // yu[l-t] for (int i = K + 1; i < U; i++) { int d = min(cs[Y], min(cs[U], cs[i])); cnt += d; cs[Y] -= d; cs[U] -= d; cs[i] -= d; } // yuu d = min(cs[Y], cs[U] / 2); cnt += d; cs[Y] -= d; cs[U] -= d * 2; // y[v-x] for (int i = U + 1; i < Y; i++) { int d = min(cs[Y], cs[i]); cnt += d; cs[Y] -= d; cs[i] -= d; } // yy d = cs[Y] / 2; cnt += d; cs[Y] -= d * 2; // z cnt += cs[Y + 1]; printf("%d\n", cnt); return 0; }