H, W = map(int, input().split())
mp = ['#'*(W+2)]
for _ in range(H):
  mp.append('#'+input()+'#')
mp.append('#'*(W+2))

L = [[0]*(W+2) for _ in range(H+2)]
R = [[0]*(W+2) for _ in range(H+2)]
U = [[0]*(W+2) for _ in range(H+2)]
D = [[0]*(W+2) for _ in range(H+2)]

rlt = 0
for i in range(H+1):
  for j in range(W+1):
    if mp[i+1][j] == '#':
      D[i+1][j] = 0
    else:
      D[i+1][j] = D[i][j] + 1
    if mp[H-i][j] == '#':
      U[H-i][j] = 0
    else:
      U[H-i][j] = U[H-i+1][j] + 1 
    if mp[i][j+1] == '#':
      R[i][j+1] = 0
    else:
      R[i][j+1] = R[i][j] + 1
    if mp[i][W-j] == '#':
      L[i][W-j] = 0
    else:
      L[i][W-j] = L[i][W-j+1] + 1 

for i in range(1,H+1):
  for j in range(1,W+1):
    tmp = L[i][j]+R[i][j]+U[i][j]+D[i][j]-3
    if tmp > rlt:
      rlt = tmp
      
print(rlt) H, W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W mp = ['#'*(W+2)] mp ['#'*(W+2)] '#'*(W+2) '#' W+2 W 2 for _ in range(H):
  mp.append('#'+input()+'#') _ range(H) range H mp.append('#'+input()+'#') mp.append mp append '#'+input()+'#' '#'+input() '#' input() input '#' mp.append('#'*(W+2)) mp.append mp append '#'*(W+2) '#' W+2 W 2 [0]*(W+2) for _ in range(H+2) for _ in range(H+2) _ range(H+2) range H+2 H 2 for _ in range(H+2) [0]*(W+2) [0] 0 W+2 W 2 L = [[0]*(W+2) for _ in range(H+2)] L [[0]*(W+2) for _ in range(H+2)] [0]*(W+2) for _ in range(H+2) for _ in range(H+2) _ range(H+2) range H+2 H 2 for _ in range(H+2) [0]*(W+2) [0] 0 W+2 W 2 R = [[0]*(W+2) for _ in range(H+2)] R [[0]*(W+2) for _ in range(H+2)] [0]*(W+2) for _ in range(H+2) for _ in range(H+2) _ range(H+2) range H+2 H 2 for _ in range(H+2) [0]*(W+2) [0] 0 W+2 W 2 U = [[0]*(W+2) for _ in range(H+2)] U [[0]*(W+2) for _ in range(H+2)] [0]*(W+2) for _ in range(H+2) for _ in range(H+2) _ range(H+2) range H+2 H 2 for _ in range(H+2) [0]*(W+2) [0] 0 W+2 W 2 D = [[0]*(W+2) for _ in range(H+2)] D [[0]*(W+2) for _ in range(H+2)] rlt = 0 rlt 0 for i in range(H+1):
  for j in range(W+1):
    if mp[i+1][j] == '#':
      D[i+1][j] = 0
    else:
      D[i+1][j] = D[i][j] + 1
    if mp[H-i][j] == '#':
      U[H-i][j] = 0
    else:
      U[H-i][j] = U[H-i+1][j] + 1 
    if mp[i][j+1] == '#':
      R[i][j+1] = 0
    else:
      R[i][j+1] = R[i][j] + 1
    if mp[i][W-j] == '#':
      L[i][W-j] = 0
    else:
      L[i][W-j] = L[i][W-j+1] + 1  i range(H+1) range H+1 H 1 for j in range(W+1):
    if mp[i+1][j] == '#':
      D[i+1][j] = 0
    else:
      D[i+1][j] = D[i][j] + 1
    if mp[H-i][j] == '#':
      U[H-i][j] = 0
    else:
      U[H-i][j] = U[H-i+1][j] + 1 
    if mp[i][j+1] == '#':
      R[i][j+1] = 0
    else:
      R[i][j+1] = R[i][j] + 1
    if mp[i][W-j] == '#':
      L[i][W-j] = 0
    else:
      L[i][W-j] = L[i][W-j+1] + 1  j range(W+1) range W+1 W 1 if mp[i+1][j] == '#':
      D[i+1][j] = 0
    else:
      D[i+1][j] = D[i][j] + 1
     mp[i+1][j] == '#' mp[i+1][j] [i+1] mp i+1 i 1 j '#' D[i+1][j] = 0 D[i+1][j] [i+1] D i+1 i 1 j 0 D[i+1][j] = D[i][j] + 1 D[i+1][j] [i+1] D i+1 i 1 j D[i][j] + 1 D[i][j] [i] D i j 1 if mp[H-i][j] == '#':
      U[H-i][j] = 0
    else:
      U[H-i][j] = U[H-i+1][j] + 1 
     mp[H-i][j] == '#' mp[H-i][j] [H-i] mp H-i H i j '#' U[H-i][j] = 0 U[H-i][j] [H-i] U H-i H i j 0 U[H-i][j] = U[H-i+1][j] + 1 U[H-i][j] [H-i] U H-i H i j U[H-i+1][j] + 1 U[H-i+1][j] [H-i+1] U H-i+1 H-i H i 1 j 1 if mp[i][j+1] == '#':
      R[i][j+1] = 0
    else:
      R[i][j+1] = R[i][j] + 1
     mp[i][j+1] == '#' mp[i][j+1] [i] mp i j+1 j 1 '#' R[i][j+1] = 0 R[i][j+1] [i] R i j+1 j 1 0 R[i][j+1] = R[i][j] + 1 R[i][j+1] [i] R i j+1 j 1 R[i][j] + 1 R[i][j] [i] R i j 1 if mp[i][W-j] == '#':
      L[i][W-j] = 0
    else:
      L[i][W-j] = L[i][W-j+1] + 1  mp[i][W-j] == '#' mp[i][W-j] [i] mp i W-j W j '#' L[i][W-j] = 0 L[i][W-j] [i] L i W-j W j 0 L[i][W-j] = L[i][W-j+1] + 1 L[i][W-j] [i] L i W-j W j L[i][W-j+1] + 1 L[i][W-j+1] [i] L i W-j+1 W-j W j 1 1 for i in range(1,H+1):
  for j in range(1,W+1):
    tmp = L[i][j]+R[i][j]+U[i][j]+D[i][j]-3
    if tmp > rlt:
      rlt = tmp
       i range(1,H+1) range 1 H+1 H 1 for j in range(1,W+1):
    tmp = L[i][j]+R[i][j]+U[i][j]+D[i][j]-3
    if tmp > rlt:
      rlt = tmp
       j range(1,W+1) range 1 W+1 W 1 tmp = L[i][j]+R[i][j]+U[i][j]+D[i][j]-3 tmp 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 if tmp > rlt:
      rlt = tmp
       tmp > rlt tmp rlt rlt = tmp rlt tmp print(rlt) print rlt tmp = 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]-3 tmp W = map(int, input().split()) map(int, input().split()) W rlt = tmp tmp rlt R = [[0]*(W+2) for _ in range(H+2)] [[0]*(W+2) for _ in range(H+2)] R mp = ['#'*(W+2)] ['#'*(W+2)] mp rlt = 0 0 rlt H, W = map(int, input().split()) map(int, input().split()) H U = [[0]*(W+2) for _ in range(H+2)] [[0]*(W+2) for _ in range(H+2)] U L = [[0]*(W+2) for _ in range(H+2)] [[0]*(W+2) for _ in range(H+2)] L D = [[0]*(W+2) for _ in range(H+2)] [[0]*(W+2) for _ in range(H+2)] D
H, W = map(int, input().split())
mp = ['#'*(W+2)]
for _ in range(H):
  mp.append('#'+input()+'#')
mp.append('#'*(W+2))

L = [[0]*(W+2) for _ in range(H+2)]
R = [[0]*(W+2) for _ in range(H+2)]
U = [[0]*(W+2) for _ in range(H+2)]
D = [[0]*(W+2) for _ in range(H+2)]

rlt = 0
for i in range(H+1):
  for j in range(W+1):
    if mp[i+1][j] == '#':
      D[i+1][j] = 0
    else:
      D[i+1][j] = D[i][j] + 1
    if mp[H-i][j] == '#':
      U[H-i][j] = 0
    else:
      U[H-i][j] = U[H-i+1][j] + 1 
    if mp[i][j+1] == '#':
      R[i][j+1] = 0
    else:
      R[i][j+1] = R[i][j] + 1
    if mp[i][W-j] == '#':
      L[i][W-j] = 0
    else:
      L[i][W-j] = L[i][W-j+1] + 1 

for i in range(1,H+1):
  for j in range(1,W+1):
    tmp = L[i][j]+R[i][j]+U[i][j]+D[i][j]-3
    if tmp > rlt:
      rlt = tmp
      
print(rlt)