# coding: utf-8
import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

H, W = lr()
S = [list(sr()) for _ in range(H)]
S = np.array([[1 if x == '.' else 0 for x in row] for row in S], np.bool)
up = np.zeros((H, W), np.int32)
down = np.zeros((H, W), np.int32)
right = np.zeros((H, W), np.int32)
left = np.zeros((H, W), np.int32)
for i in range(H-1):
    up[i+1] = (1+up[i]) * S[i]
for i in range(H-1, 0, -1):
    down[i-1] = (1+down[i]) * S[i]
for i in range(W-1):
    left[:, i+1] = (1+left[:, i]) * S[:, i]
    #行列の列を取り出す時の記法
for i in range(W-1, 0, -1):
    right[:, i-1] = (1+right[:, i]) * S[:, i]


answer = ((up + down + left + right) * S).max() + 1
#自身を数えないことで特殊な場合をなくしている
print(answer) import sys sys import numpy as np numpy sr = lambda: sys.stdin.readline().rstrip() sr lambda: sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip ir = lambda: int(sr()) ir lambda: int(sr()) int(sr()) int sr() sr lr = lambda: list(map(int, sr().split())) lr lambda: list(map(int, sr().split())) list(map(int, sr().split())) list map(int, sr().split()) map int sr().split() ().split () sr split H, W = lr() H lr() lr W list(sr()) for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) list(sr()) list sr() sr S = [list(sr()) for _ in range(H)] S [list(sr()) for _ in range(H)] [1 if x == '.' else 0 for x in row] for row in S for row in S row S for row in S [1 if x == '.' else 0 for x in row] S = np.array([[1 if x == '.' else 0 for x in row] for row in S], np.bool) S np.array([[1 if x == '.' else 0 for x in row] for row in S], np.bool) np.array np array [[1 if x == '.' else 0 for x in row] for row in S] np.bool np bool up = np.zeros((H, W), np.int32) up np.zeros((H, W), np.int32) np.zeros np zeros (H, W) H W np.int32 np int32 down = np.zeros((H, W), np.int32) down np.zeros((H, W), np.int32) np.zeros np zeros (H, W) H W np.int32 np int32 right = np.zeros((H, W), np.int32) right np.zeros((H, W), np.int32) np.zeros np zeros (H, W) H W np.int32 np int32 left = np.zeros((H, W), np.int32) left np.zeros((H, W), np.int32) np.zeros np zeros (H, W) H W np.int32 np int32 for i in range(H-1):
    up[i+1] = (1+up[i]) * S[i] i range(H-1) range H-1 H 1 up[i+1] = (1+up[i]) * S[i] up[i+1] up i+1 i 1 (1+up[i]) * S[i] 1+up[i] 1 up[i] up i S[i] S i for i in range(H-1, 0, -1):
    down[i-1] = (1+down[i]) * S[i] i range(H-1, 0, -1) range H-1 H 1 0 -1 down[i-1] = (1+down[i]) * S[i] down[i-1] down i-1 i 1 (1+down[i]) * S[i] 1+down[i] 1 down[i] down i S[i] S i for i in range(W-1):
    left[:, i+1] = (1+left[:, i]) * S[:, i]
    #行列の列を取り出す時の記法 i range(W-1) range W-1 W 1 left[:, i+1] = (1+left[:, i]) * S[:, i] left[:, i+1] left : (1+left[:, i]) * S[:, i] 1+left[:, i] 1 left[:, i] left : S[:, i] S : for i in range(W-1, 0, -1):
    right[:, i-1] = (1+right[:, i]) * S[:, i] i range(W-1, 0, -1) range W-1 W 1 0 -1 right[:, i-1] = (1+right[:, i]) * S[:, i] right[:, i-1] right : (1+right[:, i]) * S[:, i] 1+right[:, i] 1 right[:, i] right : S[:, i] S : answer = ((up + down + left + right) * S).max() + 1 answer ((up + down + left + right) * S).max() + 1 ((up + down + left + right) * S).max() (up + down + left + right) * S).max (up + down + left + right) * S up + down + left + right up + down + left up + down up down left right S max 1 print(answer) print answer answer = ((up + down + left + right) * S).max() + 1 ((up + down + left + right) * S).max() + 1 answer W = lr() lr() W up = np.zeros((H, W), np.int32) np.zeros((H, W), np.int32) up left = np.zeros((H, W), np.int32) np.zeros((H, W), np.int32) left S = np.array([[1 if x == '.' else 0 for x in row] for row in S], np.bool) np.array([[1 if x == '.' else 0 for x in row] for row in S], np.bool) S lr = lambda: list(map(int, sr().split())) lambda: list(map(int, sr().split())) lr H, W = lr() lr() H down = np.zeros((H, W), np.int32) np.zeros((H, W), np.int32) down right = np.zeros((H, W), np.int32) np.zeros((H, W), np.int32) right sr = lambda: sys.stdin.readline().rstrip() lambda: sys.stdin.readline().rstrip() sr S = [list(sr()) for _ in range(H)] [list(sr()) for _ in range(H)] S ir = lambda: int(sr()) lambda: int(sr()) ir
# coding: utf-8
import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

H, W = lr()
S = [list(sr()) for _ in range(H)]
S = np.array([[1 if x == '.' else 0 for x in row] for row in S], np.bool)
up = np.zeros((H, W), np.int32)
down = np.zeros((H, W), np.int32)
right = np.zeros((H, W), np.int32)
left = np.zeros((H, W), np.int32)
for i in range(H-1):
    up[i+1] = (1+up[i]) * S[i]
for i in range(H-1, 0, -1):
    down[i-1] = (1+down[i]) * S[i]
for i in range(W-1):
    left[:, i+1] = (1+left[:, i]) * S[:, i]
    #行列の列を取り出す時の記法
for i in range(W-1, 0, -1):
    right[:, i-1] = (1+right[:, i]) * S[:, i]


answer = ((up + down + left + right) * S).max() + 1
#自身を数えないことで特殊な場合をなくしている
print(answer)
