#写経AC
import numpy as np
H,W = map(int,input().split())
L = np.zeros((H,W),int)
R = np.zeros((H,W),int)
D = np.zeros((H,W),int)
U = np.zeros((H,W),int)
S = np.array([list(input()) for h in range(H)])=="."

for h in range(H):
  U[h] = S[h]*(U[h-1]+1)
  D[-h-1] = S[-h-1]*(D[-h]+1)

for w in range(W):
  L[:,w] = S[:,w]*(L[:,w-1]+1)
  R[:,-w-1] = S[:,-w-1]*(R[:,-w]+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),int) L np.zeros((H,W),int) np.zeros np zeros (H,W) H W int R = np.zeros((H,W),int) R np.zeros((H,W),int) np.zeros np zeros (H,W) H W int D = np.zeros((H,W),int) D np.zeros((H,W),int) np.zeros np zeros (H,W) H W int U = np.zeros((H,W),int) U np.zeros((H,W),int) np.zeros np zeros (H,W) H W int list(input()) for h in range(H) for h in range(H) h range(H) range H for h in range(H) list(input()) list input() input S = np.array([list(input()) for h in range(H)])=="." S np.array([list(input()) for h in range(H)])=="." np.array([list(input()) for h in range(H)]) np.array np array [list(input()) for h in range(H)] "." for h in range(H):
  U[h] = S[h]*(U[h-1]+1)
  D[-h-1] = S[-h-1]*(D[-h]+1) h range(H) range H U[h] = S[h]*(U[h-1]+1) U[h] U h S[h]*(U[h-1]+1) S[h] S h U[h-1]+1 U[h-1] U h-1 h 1 1 D[-h-1] = S[-h-1]*(D[-h]+1) D[-h-1] D -h-1 -h h 1 S[-h-1]*(D[-h]+1) S[-h-1] S -h-1 -h h 1 D[-h]+1 D[-h] D -h h 1 for w in range(W):
  L[:,w] = S[:,w]*(L[:,w-1]+1)
  R[:,-w-1] = S[:,-w-1]*(R[:,-w]+1) w range(W) range W L[:,w] = S[:,w]*(L[:,w-1]+1) L[:,w] L : S[:,w]*(L[:,w-1]+1) S[:,w] S : L[:,w-1]+1 L[:,w-1] L : 1 R[:,-w-1] = S[:,-w-1]*(R[:,-w]+1) R[:,-w-1] R : S[:,-w-1]*(R[:,-w]+1) S[:,-w-1] S : R[:,-w]+1 R[:,-w] R : 1 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 W = map(int,input().split()) map(int,input().split()) W R = np.zeros((H,W),int) np.zeros((H,W),int) R H,W = map(int,input().split()) map(int,input().split()) H S = np.array([list(input()) for h in range(H)])=="." np.array([list(input()) for h in range(H)])=="." S D = np.zeros((H,W),int) np.zeros((H,W),int) D L = np.zeros((H,W),int) np.zeros((H,W),int) L U = np.zeros((H,W),int) np.zeros((H,W),int) U
#写経AC
import numpy as np
H,W = map(int,input().split())
L = np.zeros((H,W),int)
R = np.zeros((H,W),int)
D = np.zeros((H,W),int)
U = np.zeros((H,W),int)
S = np.array([list(input()) for h in range(H)])=="."

for h in range(H):
  U[h] = S[h]*(U[h-1]+1)
  D[-h-1] = S[-h-1]*(D[-h]+1)

for w in range(W):
  L[:,w] = S[:,w]*(L[:,w-1]+1)
  R[:,-w-1] = S[:,-w-1]*(R[:,-w]+1)

print(np.max(U+D+L+R)-3)
