import std.algorithm, std.array, std.container, std.range, std.bitmanip; import std.numeric, std.math, std.bigint, std.random, core.bitop; import std.string, std.regex, std.conv, std.stdio, std.typecons; void main() { auto d = readln.chomp.to!int; auto c1 = readln.chomp; auto c2 = readln.chomp; auto ci = 'x'.repeat(d).to!string ~ c1 ~ c2 ~ 'x'.repeat(d).to!string; auto r = 0; foreach (i, c; ci) { auto di = ci.dup; if (c != 'o') { auto s = ci[i..$].countUntil!(a => a == 'o'); if (s == -1) s = ci.length - i; di[i..i + min(d, s)] = 'o'; } r = max(r, di.splitter(regex(r"x+")).map!(a => a.length).reduce!(max).to!int); } writeln(r); }