#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; //define #define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl; #define dump(x) cerr << #x << " = " << (x) << endl; #define INF (INT_MAX/2) #define PI (2*acos(0.0)) #define EPS (1e-8) #define REP(i,a,b) for(int i=(a); i<(b);++i) #define rep(i,n) REP(i,0,n) typedef long long ll; typedef unsigned long long ull; typedef pair pii; typedef pair pll; typedef vector vint; typedef vector > vvint; typedef vector vll; typedef vector > vvll; int dx[8] = {0, 1, 0, -1, 1, -1, 1, -1}; int dy[8] = {1, 0, -1, 0, 1, -1, -1, 1}; int N, alpha[256]; string s; string list[5] = {"a", "yuki", "yuk", "yu", "y"}; int rec(int n){ if(n == 5) return 0; bool flag = true; int minc = INF; for(int i = 0; i < list[n].size(); i++){ flag &= (alpha[list[n][i]] != 0); minc = min(minc, alpha[list[n][i]]); } int cnt = 0; if(flag){ for(int i = 0; i < list[n].size(); i++) alpha[list[n][i]]--; for(char c = list[n][list[n].size()-1]; c > list[n-1][list[n-1].size()-1]; c--){ if(minc == 0) break; int m = min(minc, alpha[c]); cnt += m; minc -= m; alpha[c] -= m; } } cnt += rec(n + 1); return cnt; } int solve(){ list[0][0] = char(list[0][0] - 1); for(int i = 0; i < s.size(); i++) alpha[s[i]]++; int res = alpha['z']; res += rec(1); return res; } int main(void){ ios_base::sync_with_stdio(0); cin >> N >> s; cout << solve() << endl; return 0; }