#include using namespace std; bool check(const string &s, int m) { string target = "yuki"; int p = 0; for (int i = 0; i < target.length(); i++) { int pass = 0; for (int j = 0; j < m; j++) { if (p >= s.length() || s[p] < target[i]) return false; if (s[p] > target[i]) ++pass; ++p; } m -= pass; } return s.length() - p >= m; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; string s; cin >> n >> s; sort(s.begin(), s.end()); reverse(s.begin(), s.end()); int ub = n + 1; int lb = 0; while (ub - lb > 1) { int mi = (lb + ub) / 2; if (check(s, mi)) lb = mi; else ub = mi; } cout << lb << endl; return 0; }