import numpy as np
import sys
 
def main():
    sin = sys.stdin.buffer
    H, W = map(int, sin.readline().split())
    grid = np.frombuffer(sin.read(H * (W + 1)), dtype="B") == ord(".")
    grid = grid.reshape((H, W + 1))[:, :-1]
 
    L = np.empty((H, W), dtype="i4")
    R = np.empty((H, W), dtype="i4")
    T = np.empty((H, W), dtype="i4")
    B = np.empty((H, W), dtype="i4")
 
    T[0] = grid[0]
    for i in range(1, H):
        T[i] = (T[i - 1] + 1) * grid[i]
 
    B[-1] = grid[-1]
    for i in range(H - 2, -1, -1):
        B[i] = (B[i + 1] + 1) * grid[i]
 
    L[:, 0] = grid[:, 0]
    for i in range(1, W):
        L[:, i] = (L[:, i - 1] + 1) * grid[:, i]
 
    R[:, -1] = grid[:, -1]
    for i in range(W - 2, -1, -1):
        R[:, i] = (R[:, i + 1] + 1) * grid[:, i]
 
    ans = (T + B + L + R - 3).max()
    print(ans)
 
main() import numpy as np numpy import sys sys def main():
    sin = sys.stdin.buffer
    H, W = map(int, sin.readline().split())
    grid = np.frombuffer(sin.read(H * (W + 1)), dtype="B") == ord(".")
    grid = grid.reshape((H, W + 1))[:, :-1]
 
    L = np.empty((H, W), dtype="i4")
    R = np.empty((H, W), dtype="i4")
    T = np.empty((H, W), dtype="i4")
    B = np.empty((H, W), dtype="i4")
 
    T[0] = grid[0]
    for i in range(1, H):
        T[i] = (T[i - 1] + 1) * grid[i]
 
    B[-1] = grid[-1]
    for i in range(H - 2, -1, -1):
        B[i] = (B[i + 1] + 1) * grid[i]
 
    L[:, 0] = grid[:, 0]
    for i in range(1, W):
        L[:, i] = (L[:, i - 1] + 1) * grid[:, i]
 
    R[:, -1] = grid[:, -1]
    for i in range(W - 2, -1, -1):
        R[:, i] = (R[:, i + 1] + 1) * grid[:, i]
 
    ans = (T + B + L + R - 3).max()
    print(ans)
  main sin = sys.stdin.buffer sin sys.stdin.buffer sys.stdin sys stdin buffer H, W = map(int, sin.readline().split()) H map(int, sin.readline().split()) map int sin.readline().split() sin.readline().split sin.readline() sin.readline sin readline split W grid = np.frombuffer(sin.read(H * (W + 1)), dtype="B") == ord(".") grid np.frombuffer(sin.read(H * (W + 1)), dtype="B") == ord(".") np.frombuffer(sin.read(H * (W + 1)), dtype="B") np.frombuffer np frombuffer sin.read(H * (W + 1)) sin.read sin read H * (W + 1) H W + 1 W 1 dtype="B" dtype "B" ord(".") ord "." grid = grid.reshape((H, W + 1))[:, :-1] grid grid.reshape((H, W + 1))[:, :-1] grid.reshape((H, W + 1)) grid.reshape grid reshape (H, W + 1) H W + 1 W 1 : L = np.empty((H, W), dtype="i4") L np.empty((H, W), dtype="i4") np.empty np empty (H, W) H W dtype="i4" dtype "i4" R = np.empty((H, W), dtype="i4") R np.empty((H, W), dtype="i4") np.empty np empty (H, W) H W dtype="i4" dtype "i4" T = np.empty((H, W), dtype="i4") T np.empty((H, W), dtype="i4") np.empty np empty (H, W) H W dtype="i4" dtype "i4" B = np.empty((H, W), dtype="i4") B np.empty((H, W), dtype="i4") np.empty np empty (H, W) H W dtype="i4" dtype "i4" T[0] = grid[0] T[0] T 0 grid[0] grid 0 for i in range(1, H):
        T[i] = (T[i - 1] + 1) * grid[i]
 
     i range(1, H) range 1 H T[i] = (T[i - 1] + 1) * grid[i] T[i] T i (T[i - 1] + 1) * grid[i] T[i - 1] + 1 T[i - 1] T i - 1 i 1 1 grid[i] grid i B[-1] = grid[-1] B[-1] B -1 grid[-1] grid -1 for i in range(H - 2, -1, -1):
        B[i] = (B[i + 1] + 1) * grid[i]
 
     i range(H - 2, -1, -1) range H - 2 H 2 -1 -1 B[i] = (B[i + 1] + 1) * grid[i] B[i] B i (B[i + 1] + 1) * grid[i] B[i + 1] + 1 B[i + 1] B i + 1 i 1 1 grid[i] grid i L[:, 0] = grid[:, 0] L[:, 0] L : grid[:, 0] grid : for i in range(1, W):
        L[:, i] = (L[:, i - 1] + 1) * grid[:, i]
 
     i range(1, W) range 1 W L[:, i] = (L[:, i - 1] + 1) * grid[:, i] L[:, i] L : (L[:, i - 1] + 1) * grid[:, i] L[:, i - 1] + 1 L[:, i - 1] L : 1 grid[:, i] grid : R[:, -1] = grid[:, -1] R[:, -1] R : grid[:, -1] grid : for i in range(W - 2, -1, -1):
        R[:, i] = (R[:, i + 1] + 1) * grid[:, i]
 
     i range(W - 2, -1, -1) range W - 2 W 2 -1 -1 R[:, i] = (R[:, i + 1] + 1) * grid[:, i] R[:, i] R : (R[:, i + 1] + 1) * grid[:, i] R[:, i + 1] + 1 R[:, i + 1] R : 1 grid[:, i] grid : ans = (T + B + L + R - 3).max() ans (T + B + L + R - 3).max() T + B + L + R - 3).max T + B + L + R - 3 T + B + L + R T + B + L T + B T B L R 3 max print(ans) print ans main() main def main():
    sin = sys.stdin.buffer
    H, W = map(int, sin.readline().split())
    grid = np.frombuffer(sin.read(H * (W + 1)), dtype="B") == ord(".")
    grid = grid.reshape((H, W + 1))[:, :-1]
 
    L = np.empty((H, W), dtype="i4")
    R = np.empty((H, W), dtype="i4")
    T = np.empty((H, W), dtype="i4")
    B = np.empty((H, W), dtype="i4")
 
    T[0] = grid[0]
    for i in range(1, H):
        T[i] = (T[i - 1] + 1) * grid[i]
 
    B[-1] = grid[-1]
    for i in range(H - 2, -1, -1):
        B[i] = (B[i + 1] + 1) * grid[i]
 
    L[:, 0] = grid[:, 0]
    for i in range(1, W):
        L[:, i] = (L[:, i - 1] + 1) * grid[:, i]
 
    R[:, -1] = grid[:, -1]
    for i in range(W - 2, -1, -1):
        R[:, i] = (R[:, i + 1] + 1) * grid[:, i]
 
    ans = (T + B + L + R - 3).max()
    print(ans)
  def main():
    sin = sys.stdin.buffer
    H, W = map(int, sin.readline().split())
    grid = np.frombuffer(sin.read(H * (W + 1)), dtype="B") == ord(".")
    grid = grid.reshape((H, W + 1))[:, :-1]
 
    L = np.empty((H, W), dtype="i4")
    R = np.empty((H, W), dtype="i4")
    T = np.empty((H, W), dtype="i4")
    B = np.empty((H, W), dtype="i4")
 
    T[0] = grid[0]
    for i in range(1, H):
        T[i] = (T[i - 1] + 1) * grid[i]
 
    B[-1] = grid[-1]
    for i in range(H - 2, -1, -1):
        B[i] = (B[i + 1] + 1) * grid[i]
 
    L[:, 0] = grid[:, 0]
    for i in range(1, W):
        L[:, i] = (L[:, i - 1] + 1) * grid[:, i]
 
    R[:, -1] = grid[:, -1]
    for i in range(W - 2, -1, -1):
        R[:, i] = (R[:, i + 1] + 1) * grid[:, i]
 
    ans = (T + B + L + R - 3).max()
    print(ans)
  main
import numpy as np
import sys
 
def main():
    sin = sys.stdin.buffer
    H, W = map(int, sin.readline().split())
    grid = np.frombuffer(sin.read(H * (W + 1)), dtype="B") == ord(".")
    grid = grid.reshape((H, W + 1))[:, :-1]
 
    L = np.empty((H, W), dtype="i4")
    R = np.empty((H, W), dtype="i4")
    T = np.empty((H, W), dtype="i4")
    B = np.empty((H, W), dtype="i4")
 
    T[0] = grid[0]
    for i in range(1, H):
        T[i] = (T[i - 1] + 1) * grid[i]
 
    B[-1] = grid[-1]
    for i in range(H - 2, -1, -1):
        B[i] = (B[i + 1] + 1) * grid[i]
 
    L[:, 0] = grid[:, 0]
    for i in range(1, W):
        L[:, i] = (L[:, i - 1] + 1) * grid[:, i]
 
    R[:, -1] = grid[:, -1]
    for i in range(W - 2, -1, -1):
        R[:, i] = (R[:, i + 1] + 1) * grid[:, i]
 
    ans = (T + B + L + R - 3).max()
    print(ans)
 
main()