H,W = map(int,input().split())
Gd = [list(input()) for _ in range(H)]
L = [[0]*W for _ in range(H)]
R = [[0]*W for _ in range(H)]
U = [[0]*W for _ in range(H)]
D = [[0]*W for _ in range(H)]

for h in range(H):
  for w in range(W):
    if Gd[h][w]=='#':
      R[h][w]=0
    else:
      if w==0:
        R[h][w]=1
      else:
        R[h][w]=R[h][w-1]+1
    wr=W-w-1
    if Gd[h][wr]=='#':
      L[h][wr]=0
    else:
      if w==0:
        L[h][wr]=1
      else:
        L[h][wr]=L[h][wr+1]+1

for w in range(W):
  for h in range(H):
    if Gd[h][w]=='#':
      D[h][w]=0
    else:
      if h==0:
        D[h][w]=1
      else:
        D[h][w]=D[h-1][w]+1
    hr=H-h-1
    if Gd[hr][w]=='#':
      U[hr][w]=0
    else:
      if h==0:
        U[hr][w]=1
      else:
        U[hr][w]=U[hr+1][w]+1
ret = 0
for w in range(W):
  for h in range(H):
    ret = max(ret, D[h][w]+U[h][w]+R[h][w]+L[h][w]-3)
print(ret) H,W = map(int,input().split()) H map(int,input().split()) map int input().split() ().split () input split W list(input()) for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) list(input()) list input() input Gd = [list(input()) for _ in range(H)] Gd [list(input()) for _ in range(H)] [0]*W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0]*W [0] 0 W L = [[0]*W for _ in range(H)] L [[0]*W for _ in range(H)] [0]*W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0]*W [0] 0 W R = [[0]*W for _ in range(H)] R [[0]*W for _ in range(H)] [0]*W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0]*W [0] 0 W U = [[0]*W for _ in range(H)] U [[0]*W for _ in range(H)] [0]*W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0]*W [0] 0 W D = [[0]*W for _ in range(H)] D [[0]*W for _ in range(H)] for h in range(H):
  for w in range(W):
    if Gd[h][w]=='#':
      R[h][w]=0
    else:
      if w==0:
        R[h][w]=1
      else:
        R[h][w]=R[h][w-1]+1
    wr=W-w-1
    if Gd[h][wr]=='#':
      L[h][wr]=0
    else:
      if w==0:
        L[h][wr]=1
      else:
        L[h][wr]=L[h][wr+1]+1 h range(H) range H for w in range(W):
    if Gd[h][w]=='#':
      R[h][w]=0
    else:
      if w==0:
        R[h][w]=1
      else:
        R[h][w]=R[h][w-1]+1
    wr=W-w-1
    if Gd[h][wr]=='#':
      L[h][wr]=0
    else:
      if w==0:
        L[h][wr]=1
      else:
        L[h][wr]=L[h][wr+1]+1 w range(W) range W if Gd[h][w]=='#':
      R[h][w]=0
    else:
      if w==0:
        R[h][w]=1
      else:
        R[h][w]=R[h][w-1]+1
     Gd[h][w]=='#' Gd[h][w] [h] Gd h w '#' R[h][w]=0 R[h][w] [h] R h w 0 if w==0:
        R[h][w]=1
      else:
        R[h][w]=R[h][w-1]+1
     w==0 w 0 R[h][w]=1 R[h][w] [h] R h w 1 R[h][w]=R[h][w-1]+1 R[h][w] [h] R h w R[h][w-1]+1 R[h][w-1] [h] R h w-1 w 1 1 wr=W-w-1 wr W-w-1 W-w W w 1 if Gd[h][wr]=='#':
      L[h][wr]=0
    else:
      if w==0:
        L[h][wr]=1
      else:
        L[h][wr]=L[h][wr+1]+1 Gd[h][wr]=='#' Gd[h][wr] [h] Gd h wr '#' L[h][wr]=0 L[h][wr] [h] L h wr 0 if w==0:
        L[h][wr]=1
      else:
        L[h][wr]=L[h][wr+1]+1 w==0 w 0 L[h][wr]=1 L[h][wr] [h] L h wr 1 L[h][wr]=L[h][wr+1]+1 L[h][wr] [h] L h wr L[h][wr+1]+1 L[h][wr+1] [h] L h wr+1 wr 1 1 for w in range(W):
  for h in range(H):
    if Gd[h][w]=='#':
      D[h][w]=0
    else:
      if h==0:
        D[h][w]=1
      else:
        D[h][w]=D[h-1][w]+1
    hr=H-h-1
    if Gd[hr][w]=='#':
      U[hr][w]=0
    else:
      if h==0:
        U[hr][w]=1
      else:
        U[hr][w]=U[hr+1][w]+1 w range(W) range W for h in range(H):
    if Gd[h][w]=='#':
      D[h][w]=0
    else:
      if h==0:
        D[h][w]=1
      else:
        D[h][w]=D[h-1][w]+1
    hr=H-h-1
    if Gd[hr][w]=='#':
      U[hr][w]=0
    else:
      if h==0:
        U[hr][w]=1
      else:
        U[hr][w]=U[hr+1][w]+1 h range(H) range H if Gd[h][w]=='#':
      D[h][w]=0
    else:
      if h==0:
        D[h][w]=1
      else:
        D[h][w]=D[h-1][w]+1
     Gd[h][w]=='#' Gd[h][w] [h] Gd h w '#' D[h][w]=0 D[h][w] [h] D h w 0 if h==0:
        D[h][w]=1
      else:
        D[h][w]=D[h-1][w]+1
     h==0 h 0 D[h][w]=1 D[h][w] [h] D h w 1 D[h][w]=D[h-1][w]+1 D[h][w] [h] D h w D[h-1][w]+1 D[h-1][w] [h-1] D h-1 h 1 w 1 hr=H-h-1 hr H-h-1 H-h H h 1 if Gd[hr][w]=='#':
      U[hr][w]=0
    else:
      if h==0:
        U[hr][w]=1
      else:
        U[hr][w]=U[hr+1][w]+1 Gd[hr][w]=='#' Gd[hr][w] [hr] Gd hr w '#' U[hr][w]=0 U[hr][w] [hr] U hr w 0 if h==0:
        U[hr][w]=1
      else:
        U[hr][w]=U[hr+1][w]+1 h==0 h 0 U[hr][w]=1 U[hr][w] [hr] U hr w 1 U[hr][w]=U[hr+1][w]+1 U[hr][w] [hr] U hr w U[hr+1][w]+1 U[hr+1][w] [hr+1] U hr+1 hr 1 w 1 ret = 0 ret 0 for w in range(W):
  for h in range(H):
    ret = max(ret, D[h][w]+U[h][w]+R[h][w]+L[h][w]-3) w range(W) range W for h in range(H):
    ret = max(ret, D[h][w]+U[h][w]+R[h][w]+L[h][w]-3) h range(H) range H ret = max(ret, D[h][w]+U[h][w]+R[h][w]+L[h][w]-3) ret max(ret, D[h][w]+U[h][w]+R[h][w]+L[h][w]-3) max ret D[h][w]+U[h][w]+R[h][w]+L[h][w]-3 D[h][w]+U[h][w]+R[h][w]+L[h][w] D[h][w]+U[h][w]+R[h][w] D[h][w]+U[h][w] D[h][w] [h] D h w U[h][w] [h] U h w R[h][w] [h] R h w L[h][w] [h] L h w 3 print(ret) print ret D = [[0]*W for _ in range(H)] [[0]*W for _ in range(H)] D H,W = map(int,input().split()) map(int,input().split()) H wr=W-w-1 W-w-1 wr ret = max(ret, D[h][w]+U[h][w]+R[h][w]+L[h][w]-3) max(ret, D[h][w]+U[h][w]+R[h][w]+L[h][w]-3) ret U = [[0]*W for _ in range(H)] [[0]*W for _ in range(H)] U L = [[0]*W for _ in range(H)] [[0]*W for _ in range(H)] L W = map(int,input().split()) map(int,input().split()) W hr=H-h-1 H-h-1 hr Gd = [list(input()) for _ in range(H)] [list(input()) for _ in range(H)] Gd ret = 0 0 ret R = [[0]*W for _ in range(H)] [[0]*W for _ in range(H)] R
H,W = map(int,input().split())
Gd = [list(input()) for _ in range(H)]
L = [[0]*W for _ in range(H)]
R = [[0]*W for _ in range(H)]
U = [[0]*W for _ in range(H)]
D = [[0]*W for _ in range(H)]

for h in range(H):
  for w in range(W):
    if Gd[h][w]=='#':
      R[h][w]=0
    else:
      if w==0:
        R[h][w]=1
      else:
        R[h][w]=R[h][w-1]+1
    wr=W-w-1
    if Gd[h][wr]=='#':
      L[h][wr]=0
    else:
      if w==0:
        L[h][wr]=1
      else:
        L[h][wr]=L[h][wr+1]+1

for w in range(W):
  for h in range(H):
    if Gd[h][w]=='#':
      D[h][w]=0
    else:
      if h==0:
        D[h][w]=1
      else:
        D[h][w]=D[h-1][w]+1
    hr=H-h-1
    if Gd[hr][w]=='#':
      U[hr][w]=0
    else:
      if h==0:
        U[hr][w]=1
      else:
        U[hr][w]=U[hr+1][w]+1
ret = 0
for w in range(W):
  for h in range(H):
    ret = max(ret, D[h][w]+U[h][w]+R[h][w]+L[h][w]-3)
print(ret)
