import numpy as np
H, W = map(int, input().split())
S = np.zeros((H,W))
for i in range(H):
    Si = np.array([int(s == '.') for s in input()])
    S[i] = Si
    
top = S.copy()
bottom = S.copy()
left = S.copy()
right = S.copy()

for i in range(1, H):
    top[i] = (top[i-1] + 1) * S[i]
    bottom[-i-1] = (bottom[-i] + 1) * S[-i-1]

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

print(np.max((top + bottom + left + right - 3).astype(np.int))) 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.zeros((H,W)) S np.zeros((H,W)) np.zeros np zeros (H,W) H W for i in range(H):
    Si = np.array([int(s == '.') for s in input()])
    S[i] = Si
     i range(H) range H int(s == '.') for s in input() for s in input() s input() input for s in input() int(s == '.') int s == '.' s '.' Si = np.array([int(s == '.') for s in input()]) Si np.array([int(s == '.') for s in input()]) np.array np array [int(s == '.') for s in input()] S[i] = Si S[i] S i Si top = S.copy() top S.copy() S.copy S copy bottom = S.copy() bottom 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):
    top[i] = (top[i-1] + 1) * S[i]
    bottom[-i-1] = (bottom[-i] + 1) * S[-i-1] i range(1, H) range 1 H top[i] = (top[i-1] + 1) * S[i] top[i] top i (top[i-1] + 1) * S[i] top[i-1] + 1 top[i-1] top i-1 i 1 1 S[i] S i bottom[-i-1] = (bottom[-i] + 1) * S[-i-1] bottom[-i-1] bottom -i-1 -i i 1 (bottom[-i] + 1) * S[-i-1] bottom[-i] + 1 bottom[-i] bottom -i i 1 S[-i-1] S -i-1 -i i 1 for j in range(1, W):
    left[:,j] = (left[:,j-1] + 1) * S[:,j]
    right[:,-j-1] = (right[:,-j] + 1) * S[:,-j-1] j range(1, W) range 1 W left[:,j] = (left[:,j-1] + 1) * S[:,j] left[:,j] left : (left[:,j-1] + 1) * S[:,j] left[:,j-1] + 1 left[:,j-1] left : 1 S[:,j] S : right[:,-j-1] = (right[:,-j] + 1) * S[:,-j-1] right[:,-j-1] right : (right[:,-j] + 1) * S[:,-j-1] right[:,-j] + 1 right[:,-j] right : 1 S[:,-j-1] S : print(np.max((top + bottom + left + right - 3).astype(np.int))) print np.max((top + bottom + left + right - 3).astype(np.int)) np.max np max (top + bottom + left + right - 3).astype(np.int) top + bottom + left + right - 3).astype top + bottom + left + right - 3 top + bottom + left + right top + bottom + left top + bottom top bottom left right 3 astype np.int np int S = np.zeros((H,W)) np.zeros((H,W)) S right = S.copy() S.copy() right H, W = map(int, input().split()) map(int, input().split()) H Si = np.array([int(s == '.') for s in input()]) np.array([int(s == '.') for s in input()]) Si W = map(int, input().split()) map(int, input().split()) W left = S.copy() S.copy() left top = S.copy() S.copy() top bottom = S.copy() S.copy() bottom
import numpy as np
H, W = map(int, input().split())
S = np.zeros((H,W))
for i in range(H):
    Si = np.array([int(s == '.') for s in input()])
    S[i] = Si
    
top = S.copy()
bottom = S.copy()
left = S.copy()
right = S.copy()

for i in range(1, H):
    top[i] = (top[i-1] + 1) * S[i]
    bottom[-i-1] = (bottom[-i] + 1) * S[-i-1]

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

print(np.max((top + bottom + left + right - 3).astype(np.int)))