import std.algorithm; import std.array; import std.ascii; import std.container; import std.conv; import std.math; import std.numeric; import std.range; import std.stdio; import std.string; import std.typecons; void log(A...)(A arg) { stderr.writeln(arg); } int size(T)(in T s) { return cast(int)s.length; } void main() { auto N = readln.chomp.to!int; auto s = readln; auto r = 0; auto ans = s.count!"a == 'z'"; auto prev = s.count!"a == 'y'"; foreach (p ; zip("yuk", "uki")) { //log("p: ", p); int nprev = 0; foreach (c ; s) { if (p[1] < c && c < p[0]) { if (prev > 0) { prev--; ans++; } } else if (p[1] == c) { nprev++; } } assert(prev >= 0 && nprev >= 0 && r >= 0); if (p[0] == 'y') { auto d = max(0, prev - nprev) / 2; ans += d; r += max(0, prev - nprev - 2 * d); } else { r += abs(prev - nprev); } ans += min(prev, r); prev -= min(prev, r); prev = min(prev, nprev); } writeln(ans); }