import numpy as np

H, W = map(int, input().split(' '))

S = np.array([[int(c == '.') for c in input()] for _ in range(H)])

up = S.copy()
down = S.copy()
left = S.copy()
right = S.copy()

for i in range(1, H):
    up[i] = (up[i - 1] + 1) * up[i]
    down[-i - 1] = (down[-i] + 1) * down[-i - 1]

for i in range(1, W):
    left[:, i] = (left[:, i - 1] + 1) * left[:, i]
    right[:, -i - 1] = (right[:, -i] + 1) * right[:, -i - 1]

print(np.max(up + down + left + right) - 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 [int(c == '.') for c in input()] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [int(c == '.') for c in input()] S = np.array([[int(c == '.') for c in input()] for _ in range(H)]) S np.array([[int(c == '.') for c in input()] for _ in range(H)]) np.array np array [[int(c == '.') for c in input()] for _ in range(H)] up = S.copy() up S.copy() S.copy S copy down = S.copy() down S.copy() S.copy S copy left = S.copy() left S.copy() S.copy S copy right = S.copy() right S.copy() S.copy S copy for i in range(1, H):
    up[i] = (up[i - 1] + 1) * up[i]
    down[-i - 1] = (down[-i] + 1) * down[-i - 1] i range(1, H) range 1 H up[i] = (up[i - 1] + 1) * up[i] up[i] up i (up[i - 1] + 1) * up[i] up[i - 1] + 1 up[i - 1] up i - 1 i 1 1 up[i] up i down[-i - 1] = (down[-i] + 1) * down[-i - 1] down[-i - 1] down -i - 1 -i i 1 (down[-i] + 1) * down[-i - 1] down[-i] + 1 down[-i] down -i i 1 down[-i - 1] down -i - 1 -i i 1 for i in range(1, W):
    left[:, i] = (left[:, i - 1] + 1) * left[:, i]
    right[:, -i - 1] = (right[:, -i] + 1) * right[:, -i - 1] i range(1, W) range 1 W left[:, i] = (left[:, i - 1] + 1) * left[:, i] left[:, i] left : (left[:, i - 1] + 1) * left[:, i] left[:, i - 1] + 1 left[:, i - 1] left : 1 left[:, i] left : right[:, -i - 1] = (right[:, -i] + 1) * right[:, -i - 1] right[:, -i - 1] right : (right[:, -i] + 1) * right[:, -i - 1] right[:, -i] + 1 right[:, -i] right : 1 right[:, -i - 1] right : print(np.max(up + down + left + right) - 3) print np.max(up + down + left + right) - 3 np.max(up + down + left + right) np.max np max up + down + left + right up + down + left up + down up down left right 3 up = S.copy() S.copy() up H, W = map(int, input().split(' ')) map(int, input().split(' ')) H S = np.array([[int(c == '.') for c in input()] for _ in range(H)]) np.array([[int(c == '.') for c in input()] for _ in range(H)]) S down = S.copy() S.copy() down right = S.copy() S.copy() right W = map(int, input().split(' ')) map(int, input().split(' ')) W left = S.copy() S.copy() left
import numpy as np

H, W = map(int, input().split(' '))

S = np.array([[int(c == '.') for c in input()] for _ in range(H)])

up = S.copy()
down = S.copy()
left = S.copy()
right = S.copy()

for i in range(1, H):
    up[i] = (up[i - 1] + 1) * up[i]
    down[-i - 1] = (down[-i] + 1) * down[-i - 1]

for i in range(1, W):
    left[:, i] = (left[:, i - 1] + 1) * left[:, i]
    right[:, -i - 1] = (right[:, -i] + 1) * right[:, -i - 1]

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