import numpy as np

import sys

buf = sys.stdin.buffer



H,W = list(map(int,buf.readline().split()))

# 周りに壁を、0,1化、壁を0で持つ

grid = np.zeros((H+2,W+2),dtype=np.bool)

grid[1:-1,1:] = (np.frombuffer(buf.read(H*(W+1)),dtype='S1') == b'.').reshape((H,W+1))



# x軸方向の集計

def F(transpose):

  x = grid

  if transpose:

    x = (x.T).copy()

  x = np.ravel(x) # to 1D array

  L = len(x)

  

  left_zero = np.where(x,0,-np.arange(L)) # 左の壁のindexの-1倍

  np.minimum.accumulate(left_zero, out=left_zero)

  

  right_zero = np.where(x[::-1],0,np.arange(L)) # 逆順ソートした上で左の壁のindex

  np.maximum.accumulate(right_zero, out=right_zero)

  

  y = left_zero

  y += L-right_zero[::-1]

  

  return y.reshape(grid.T.shape).T if transpose else y.reshape(grid.shape)

  

answer = (F(False) + F(True)).max()-5

print(answer)

import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



import numpy as np



H,W = list(map(int,readline().split()))

floor = np.frombuffer(read(),dtype='S1').reshape(H,-1)[:,:W] == b'.'



score = np.zeros((H,W),np.int32)



x = np.zeros((H,W),np.int32)

for n in range(1,H):

    x[n] = (1+x[n-1])*floor[n-1]

score += x



x[:] = 0

for n in range(H-1,0,-1):

    x[n-1] = (1+x[n])*floor[n]

score += x



x[:] = 0

for n in range(1,W):

    x[:,n] = (1+x[:,n-1])*floor[:,n-1]

score += x



x[:] = 0

for n in range(W-1,0,-1):

    x[:,n-1] = (1+x[:,n])*floor[:,n]

score += x



score *= floor

answer = score.max() + 1

print(answer)
import numpy as np
import sys

buf = sys.stdin.buffer
H, W = list(map(int, buf.readline().split()))
# 周りに壁を、0,1化、壁を0で持つ
grid = np.zeros((H + 2, W + 2), dtype=np.bool)
grid[1:-1, 1:] = (np.frombuffer(buf.read(H * (W + 1)), dtype="S1") == b".").reshape(
    (H, W + 1)
)
# x軸方向の集計
def F(transpose):
    x = grid
    if transpose:
        x = (x.T).copy()
    x = np.ravel(x)  # to 1D array
    L = len(x)
    left_zero = np.where(x, 0, -np.arange(L))  # 左の壁のindexの-1倍
    np.minimum.accumulate(left_zero, out=left_zero)
    right_zero = np.where(x[::-1], 0, np.arange(L))  # 逆順ソートした上で左の壁のindex
    np.maximum.accumulate(right_zero, out=right_zero)
    y = left_zero
    y += L - right_zero[::-1]
    return y.reshape(grid.T.shape).T if transpose else y.reshape(grid.shape)


answer = (F(False) + F(True)).max() - 5
print(answer)

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np

H, W = list(map(int, readline().split()))
floor = np.frombuffer(read(), dtype="S1").reshape(H, -1)[:, :W] == b"."
score = np.zeros((H, W), np.int32)
x = np.zeros((H, W), np.int32)
for n in range(1, H):
    x[n] = (1 + x[n - 1]) * floor[n - 1]
score += x
x[:] = 0
for n in range(H - 1, 0, -1):
    x[n - 1] = (1 + x[n]) * floor[n]
score += x
x[:] = 0
for n in range(1, W):
    x[:, n] = (1 + x[:, n - 1]) * floor[:, n - 1]
score += x
x[:] = 0
for n in range(W - 1, 0, -1):
    x[:, n - 1] = (1 + x[:, n]) * floor[:, n]
score += x
score *= floor
answer = score.max() + 1
print(answer)

-import numpy as np -buf = sys.stdin.buffer -H, W = list(map(int, buf.readline().split())) -# 周りに壁を、0,1化、壁を0で持つ -grid = np.zeros((H + 2, W + 2), dtype=np.bool) -grid[1:-1, 1:] = (np.frombuffer(buf.read(H * (W + 1)), dtype="S1") == b".").reshape( -    (H, W + 1) -) -# x軸方向の集計 -def F(transpose): -    x = grid -    if transpose: -        x = (x.T).copy() -    x = np.ravel(x)  # to 1D array -    L = len(x) -    left_zero = np.where(x, 0, -np.arange(L))  # 左の壁のindexの-1倍 -    np.minimum.accumulate(left_zero, out=left_zero) -    right_zero = np.where(x[::-1], 0, np.arange(L))  # 逆順ソートした上で左の壁のindex -    np.maximum.accumulate(right_zero, out=right_zero) -    y = left_zero -    y += L - right_zero[::-1] -    return y.reshape(grid.T.shape).T if transpose else y.reshape(grid.shape) +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines +import numpy as np - -answer = (F(False) + F(True)).max() - 5 +H, W = list(map(int, readline().split())) +floor = np.frombuffer(read(), dtype="S1").reshape(H, -1)[:, :W] == b"." +score = np.zeros((H, W), np.int32) +x = np.zeros((H, W), np.int32) +for n in range(1, H): +    x[n] = (1 + x[n - 1]) * floor[n - 1] +score += x +x[:] = 0 +for n in range(H - 1, 0, -1): +    x[n - 1] = (1 + x[n]) * floor[n] +score += x +x[:] = 0 +for n in range(1, W): +    x[:, n] = (1 + x[:, n - 1]) * floor[:, n - 1] +score += x +x[:] = 0 +for n in range(W - 1, 0, -1): +    x[:, n - 1] = (1 + x[:, n]) * floor[:, n] +score += x +score *= floor +answer = score.max() + 1