import std.stdio, std.array, std.string, std.conv, std.algorithm; import std.typecons, std.range, std.random, std.math, std.container; import std.numeric, std.bigint, core.bitop, std.bitmanip; const long MOD = 10^^9 + 7; void main() { auto N = readln.chomp.to!int; auto A = N.iota.map!(_ => readln.chomp).array; auto tate1 = new bool[](N); auto tate2 = new bool[](N); auto yoko1 = new bool[](N); auto yoko2 = new bool[](N); foreach (i; 0..N) { tate1[i] = iota(N-1).map!(j => A[j][i] == '.').all; tate2[i] = iota(1,N).map!(j => A[j][i] == '.').all; yoko1[i] = iota(N-1).map!(j => A[i][j] == '.').all; yoko2[i] = iota(1,N).map!(j => A[i][j] == '.').all; } int ans = 0; int tmp; // tateのみ tmp = 0; foreach (i; 0..N) tmp += tate1[i] || tate2[i]; ans = max(ans, tmp); // yokoのみ tmp = 0; foreach (i; 0..N) tmp += yoko1[i] || yoko2[i]; ans = max(ans, tmp); // tate1 + yoko tmp = 0; foreach (i; 0..N) tmp += tate1[i]; tmp += yoko1[N-1] || yoko2[N-1]; ans = max(ans, tmp); // tate2 + yoko tmp = 0; foreach (i; 0..N) tmp += tate2[i]; tmp += yoko1[0] || yoko2[0]; ans = max(ans, tmp); // yoko1 + tate tmp = 0; foreach (i; 0..N) tmp += yoko1[i]; tmp += tate1[N-1] || tate2[N-1]; ans = max(ans, tmp); // yoko2 + tate tmp = 0; foreach (i; 0..N) tmp += yoko2[i]; tmp += tate1[0] || tate2[0]; ans = max(ans, tmp); ans.writeln; }