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) { if (c == 'o') continue; auto s = ci[i..$].countUntil!(a => a == 'o'); if (s == -1) s = ci.length - i; auto di = ci.dup; 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); }