import numpy as np
H, W = map(int,input().split())
l = np.zeros((H,W), dtype=int)
r = np.zeros((H,W), dtype=int)
d = np.zeros((H,W), dtype=int)
u = np.zeros((H,W), dtype=int)
s = np.array([list(input()) for _ in range(H)]) == "."
for i in range(H):
    u[i] = (u[i-1]+1)*s[i]
    d[-i-1] = (d[-i]+1)*s[-i-1]
for i in range(W):
    l[:, i] = (l[:, i-1]+1)*s[:, i]
    r[:, -i-1] = (r[:, -i]+1)*s[:, -i-1]
print(np.max(u+d+l+r)-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 l = np.zeros((H,W), dtype=int) l np.zeros((H,W), dtype=int) np.zeros np zeros (H,W) H W dtype=int dtype int r = np.zeros((H,W), dtype=int) r np.zeros((H,W), dtype=int) np.zeros np zeros (H,W) H W dtype=int dtype int d = np.zeros((H,W), dtype=int) d np.zeros((H,W), dtype=int) np.zeros np zeros (H,W) H W dtype=int dtype int u = np.zeros((H,W), dtype=int) u np.zeros((H,W), dtype=int) np.zeros np zeros (H,W) H W dtype=int dtype int list(input()) for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) list(input()) list input() input s = np.array([list(input()) for _ in range(H)]) == "." s np.array([list(input()) for _ in range(H)]) == "." np.array([list(input()) for _ in range(H)]) np.array np array [list(input()) for _ in range(H)] "." for i in range(H):
    u[i] = (u[i-1]+1)*s[i]
    d[-i-1] = (d[-i]+1)*s[-i-1] i range(H) range H u[i] = (u[i-1]+1)*s[i] u[i] u i (u[i-1]+1)*s[i] u[i-1]+1 u[i-1] u i-1 i 1 1 s[i] s i d[-i-1] = (d[-i]+1)*s[-i-1] d[-i-1] d -i-1 -i i 1 (d[-i]+1)*s[-i-1] d[-i]+1 d[-i] d -i i 1 s[-i-1] s -i-1 -i i 1 for i in range(W):
    l[:, i] = (l[:, i-1]+1)*s[:, i]
    r[:, -i-1] = (r[:, -i]+1)*s[:, -i-1] i range(W) range W l[:, i] = (l[:, i-1]+1)*s[:, i] l[:, i] l : (l[:, i-1]+1)*s[:, i] l[:, i-1]+1 l[:, i-1] l : 1 s[:, i] s : r[:, -i-1] = (r[:, -i]+1)*s[:, -i-1] r[:, -i-1] r : (r[:, -i]+1)*s[:, -i-1] r[:, -i]+1 r[:, -i] r : 1 s[:, -i-1] s : print(np.max(u+d+l+r)-3) print np.max(u+d+l+r)-3 np.max(u+d+l+r) np.max np max u+d+l+r u+d+l u+d u d l r 3 H, W = map(int,input().split()) map(int,input().split()) H s = np.array([list(input()) for _ in range(H)]) == "." np.array([list(input()) for _ in range(H)]) == "." s W = map(int,input().split()) map(int,input().split()) W r = np.zeros((H,W), dtype=int) np.zeros((H,W), dtype=int) r l = np.zeros((H,W), dtype=int) np.zeros((H,W), dtype=int) l d = np.zeros((H,W), dtype=int) np.zeros((H,W), dtype=int) d u = np.zeros((H,W), dtype=int) np.zeros((H,W), dtype=int) u
import numpy as np
H, W = map(int,input().split())
l = np.zeros((H,W), dtype=int)
r = np.zeros((H,W), dtype=int)
d = np.zeros((H,W), dtype=int)
u = np.zeros((H,W), dtype=int)
s = np.array([list(input()) for _ in range(H)]) == "."
for i in range(H):
    u[i] = (u[i-1]+1)*s[i]
    d[-i-1] = (d[-i]+1)*s[-i-1]
for i in range(W):
    l[:, i] = (l[:, i-1]+1)*s[:, i]
    r[:, -i-1] = (r[:, -i]+1)*s[:, -i-1]
print(np.max(u+d+l+r)-3)