import numpy as np

h, w = map(int, input().split())
s = np.empty((h, w), dtype='i8')
for i in range(h):
    s[i] = [i == '.' for i in list(input())]

right = np.copy(s)
left = np.copy(s)
for i in range(1, w):
    right[:, -i-1] = (right[:, -i] + 1) * s[:, -i-1]
    left[:, i] = (left[:, i-1] + 1) * s[:, i]
up = np.copy(s)
down = np.copy(s)
for i in range(1, h):
    up[i] = (up[i-1] + 1) * s[i]
    down[-i-1] = (down[-i] + 1) * s[-i-1]

print(np.max(right + left + up + down) - 3) import numpy as np numpy h, w = map(int, input().split()) h map(int, input().split()) map int input().split() ().split () input split w s = np.empty((h, w), dtype='i8') s np.empty((h, w), dtype='i8') np.empty np empty (h, w) h w dtype='i8' dtype 'i8' for i in range(h):
    s[i] = [i == '.' for i in list(input())] i range(h) range h i == '.' for i in list(input()) for i in list(input()) i list(input()) list input() input for i in list(input()) i == '.' i '.' s[i] = [i == '.' for i in list(input())] s[i] s i [i == '.' for i in list(input())] right = np.copy(s) right np.copy(s) np.copy np copy s left = np.copy(s) left np.copy(s) np.copy np copy s for i in range(1, w):
    right[:, -i-1] = (right[:, -i] + 1) * s[:, -i-1]
    left[:, i] = (left[:, i-1] + 1) * s[:, i] i range(1, w) range 1 w right[:, -i-1] = (right[:, -i] + 1) * s[:, -i-1] right[:, -i-1] right : (right[:, -i] + 1) * s[:, -i-1] right[:, -i] + 1 right[:, -i] right : 1 s[:, -i-1] s : left[:, i] = (left[:, i-1] + 1) * s[:, i] left[:, i] left : (left[:, i-1] + 1) * s[:, i] left[:, i-1] + 1 left[:, i-1] left : 1 s[:, i] s : up = np.copy(s) up np.copy(s) np.copy np copy s down = np.copy(s) down np.copy(s) np.copy np copy s for i in range(1, h):
    up[i] = (up[i-1] + 1) * s[i]
    down[-i-1] = (down[-i] + 1) * s[-i-1] i range(1, h) range 1 h up[i] = (up[i-1] + 1) * s[i] up[i] up i (up[i-1] + 1) * s[i] up[i-1] + 1 up[i-1] up i-1 i 1 1 s[i] s i down[-i-1] = (down[-i] + 1) * s[-i-1] down[-i-1] down -i-1 -i i 1 (down[-i] + 1) * s[-i-1] down[-i] + 1 down[-i] down -i i 1 s[-i-1] s -i-1 -i i 1 print(np.max(right + left + up + down) - 3) print np.max(right + left + up + down) - 3 np.max(right + left + up + down) np.max np max right + left + up + down right + left + up right + left right left up down 3 down = np.copy(s) np.copy(s) down right = np.copy(s) np.copy(s) right s = np.empty((h, w), dtype='i8') np.empty((h, w), dtype='i8') s up = np.copy(s) np.copy(s) up h, w = map(int, input().split()) map(int, input().split()) h w = map(int, input().split()) map(int, input().split()) w left = np.copy(s) np.copy(s) left
import numpy as np

h, w = map(int, input().split())
s = np.empty((h, w), dtype='i8')
for i in range(h):
    s[i] = [i == '.' for i in list(input())]

right = np.copy(s)
left = np.copy(s)
for i in range(1, w):
    right[:, -i-1] = (right[:, -i] + 1) * s[:, -i-1]
    left[:, i] = (left[:, i-1] + 1) * s[:, i]
up = np.copy(s)
down = np.copy(s)
for i in range(1, h):
    up[i] = (up[i-1] + 1) * s[i]
    down[-i-1] = (down[-i] + 1) * s[-i-1]

print(np.max(right + left + up + down) - 3)
