import std.algorithm, std.conv, std.range, std.stdio, std.string; void main() { auto d = readln.chomp.to!int; auto wd = 'x'.repeat.take(d).array, hd = 'o'.repeat.take(d).array; auto s1 = readln.chomp, s2 = readln.chomp, s = wd ~ s1 ~ s2 ~ wd; auto r = 0; foreach (i; 0..s.length-d) { if (s[i..i+d] == wd) { auto t = s.dup; t[i..i+d] = hd; r = max(r, t.group.filter!"a[0] == 'o'".map!"a[1]".maxElement); } } writeln(r); }