import numpy as np
import sys
input = sys.stdin.readline

H,W = map(int,input().split())
S=np.array([list(input().rstrip("\n")) for _ in range(H)]) == '.'

D = np.zeros((H,W),dtype=int)
U = np.zeros((H,W),dtype=int)
L = np.zeros((H,W),dtype=int)
R = np.zeros((H,W),dtype=int)

# 上下
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 import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline H,W = map(int,input().split()) H map(int,input().split()) map int input().split() ().split () input split W list(input().rstrip("\n")) for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) list(input().rstrip("\n")) list input().rstrip("\n") ().rstrip () input rstrip "\n" S=np.array([list(input().rstrip("\n")) for _ in range(H)]) == '.' S np.array([list(input().rstrip("\n")) for _ in range(H)]) == '.' np.array([list(input().rstrip("\n")) for _ in range(H)]) np.array np array [list(input().rstrip("\n")) for _ in range(H)] '.' 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 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 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 D = np.zeros((H,W),dtype=int) np.zeros((H,W),dtype=int) D S=np.array([list(input().rstrip("\n")) for _ in range(H)]) == '.' np.array([list(input().rstrip("\n")) for _ in range(H)]) == '.' S U = np.zeros((H,W),dtype=int) np.zeros((H,W),dtype=int) U W = map(int,input().split()) map(int,input().split()) W input = sys.stdin.readline sys.stdin.readline input L = np.zeros((H,W),dtype=int) np.zeros((H,W),dtype=int) L R = np.zeros((H,W),dtype=int) np.zeros((H,W),dtype=int) R
import numpy as np
import sys
input = sys.stdin.readline

H,W = map(int,input().split())
S=np.array([list(input().rstrip("\n")) for _ in range(H)]) == '.'

D = np.zeros((H,W),dtype=int)
U = np.zeros((H,W),dtype=int)
L = np.zeros((H,W),dtype=int)
R = np.zeros((H,W),dtype=int)

# 上下
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)
