import copy

H, W = map(int, input().split())
grid = [[1 if c == "." else 0 for c in input()] for _ in range(H)]

L = copy.deepcopy(grid)
R = copy.deepcopy(grid)
U = copy.deepcopy(grid)
D = copy.deepcopy(grid)

for i in range(H):
  for j in range(1, W):
    L[i][j] = (L[i][j-1] + 1) * L[i][j]
    R[i][-1-j] = (R[i][-j] + 1) * R[i][-1-j]

for j in range(W):
  for i in range(1, H):
    U[i][j] = (U[i-1][j] + 1) * U[i][j]
    D[-1-i][j] = (D[-i][j] + 1) * D[-1-i][j]

ans = 0

for i in range(H):
  for j in range(W):
    ans = max(ans, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3, 0)

print(ans) import copy copy H, W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W [1 if c == "." else 0 for c in input()] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [1 if c == "." else 0 for c in input()] grid = [[1 if c == "." else 0 for c in input()] for _ in range(H)] grid [[1 if c == "." else 0 for c in input()] for _ in range(H)] L = copy.deepcopy(grid) L copy.deepcopy(grid) copy.deepcopy copy deepcopy grid R = copy.deepcopy(grid) R copy.deepcopy(grid) copy.deepcopy copy deepcopy grid U = copy.deepcopy(grid) U copy.deepcopy(grid) copy.deepcopy copy deepcopy grid D = copy.deepcopy(grid) D copy.deepcopy(grid) copy.deepcopy copy deepcopy grid for i in range(H):
  for j in range(1, W):
    L[i][j] = (L[i][j-1] + 1) * L[i][j]
    R[i][-1-j] = (R[i][-j] + 1) * R[i][-1-j] i range(H) range H for j in range(1, W):
    L[i][j] = (L[i][j-1] + 1) * L[i][j]
    R[i][-1-j] = (R[i][-j] + 1) * R[i][-1-j] j range(1, W) range 1 W L[i][j] = (L[i][j-1] + 1) * L[i][j] L[i][j] [i] L i j (L[i][j-1] + 1) * L[i][j] L[i][j-1] + 1 L[i][j-1] [i] L i j-1 j 1 1 L[i][j] [i] L i j R[i][-1-j] = (R[i][-j] + 1) * R[i][-1-j] R[i][-1-j] [i] R i -1-j -1 j (R[i][-j] + 1) * R[i][-1-j] R[i][-j] + 1 R[i][-j] [i] R i -j j 1 R[i][-1-j] [i] R i -1-j -1 j for j in range(W):
  for i in range(1, H):
    U[i][j] = (U[i-1][j] + 1) * U[i][j]
    D[-1-i][j] = (D[-i][j] + 1) * D[-1-i][j] j range(W) range W for i in range(1, H):
    U[i][j] = (U[i-1][j] + 1) * U[i][j]
    D[-1-i][j] = (D[-i][j] + 1) * D[-1-i][j] i range(1, H) range 1 H U[i][j] = (U[i-1][j] + 1) * U[i][j] U[i][j] [i] U i j (U[i-1][j] + 1) * U[i][j] U[i-1][j] + 1 U[i-1][j] [i-1] U i-1 i 1 j 1 U[i][j] [i] U i j D[-1-i][j] = (D[-i][j] + 1) * D[-1-i][j] D[-1-i][j] [-1-i] D -1-i -1 i j (D[-i][j] + 1) * D[-1-i][j] D[-i][j] + 1 D[-i][j] [-i] D -i i j 1 D[-1-i][j] [-1-i] D -1-i -1 i j ans = 0 ans 0 for i in range(H):
  for j in range(W):
    ans = max(ans, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3, 0) i range(H) range H for j in range(W):
    ans = max(ans, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3, 0) j range(W) range W ans = max(ans, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3, 0) ans max(ans, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3, 0) max ans L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3 L[i][j] + R[i][j] + U[i][j] + D[i][j] L[i][j] + R[i][j] + U[i][j] L[i][j] + R[i][j] L[i][j] [i] L i j R[i][j] [i] R i j U[i][j] [i] U i j D[i][j] [i] D i j 3 0 print(ans) print ans W = map(int, input().split()) map(int, input().split()) W grid = [[1 if c == "." else 0 for c in input()] for _ in range(H)] [[1 if c == "." else 0 for c in input()] for _ in range(H)] grid ans = max(ans, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3, 0) max(ans, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3, 0) ans L = copy.deepcopy(grid) copy.deepcopy(grid) L R = copy.deepcopy(grid) copy.deepcopy(grid) R U = copy.deepcopy(grid) copy.deepcopy(grid) U D = copy.deepcopy(grid) copy.deepcopy(grid) D ans = 0 0 ans H, W = map(int, input().split()) map(int, input().split()) H
import copy

H, W = map(int, input().split())
grid = [[1 if c == "." else 0 for c in input()] for _ in range(H)]

L = copy.deepcopy(grid)
R = copy.deepcopy(grid)
U = copy.deepcopy(grid)
D = copy.deepcopy(grid)

for i in range(H):
  for j in range(1, W):
    L[i][j] = (L[i][j-1] + 1) * L[i][j]
    R[i][-1-j] = (R[i][-j] + 1) * R[i][-1-j]

for j in range(W):
  for i in range(1, H):
    U[i][j] = (U[i-1][j] + 1) * U[i][j]
    D[-1-i][j] = (D[-i][j] + 1) * D[-1-i][j]

ans = 0

for i in range(H):
  for j in range(W):
    ans = max(ans, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3, 0)

print(ans)
