H,W = map(int,input().split())

s = []
l = [[0] * W for i in range(H)]
r = [[0] * W for i in range(H)]
u = [[0] * W for i in range(H)]
d= [[0] * W for i in range(H)]
  
for i in range(H):
    tmp =list(input())
    s.append(tmp)

for y in range(H):
  for x in range(W):
    if s[y][x] == "#":
      continue
    elif x == 0:
      l[y][x] = 1
    else:
      l[y][x] = l[y][x-1] + 1

for y in range(H):
  for x in range(W-1, -1, -1):
    if s[y][x] == "#":
      continue
    elif x == W - 1:
      r[y][x] = 1
    else:
      r[y][x] = r[y][x+1] + 1
      
for y in range(H):
  for x in range(W):
    if s[y][x] == "#":
      continue
    elif y == 0:
      u[y][x] = 1
    else:
      u[y][x] = u[y-1][x] + 1
      
for y in range(H-1, -1, -1):
  for x in range(W):
    if s[y][x] == "#":
      continue
    elif y == H - 1:
      d[y][x] = 1
    else:
      d[y][x] = d[y+1][x] + 1

ans = 0
for x in range(H):
  for y in range(W):
    if ans < l[x][y] + r[x][y] + u[x][y] + d[x][y] - 3:
      ans = l[x][y] + r[x][y] + u[x][y] + d[x][y] - 3
      
print(ans) H,W = map(int,input().split()) H map(int,input().split()) map int input().split() ().split () input split W s = [] s [] [0] * W for i in range(H) for i in range(H) i range(H) range H for i in range(H) [0] * W [0] 0 W l = [[0] * W for i in range(H)] l [[0] * W for i in range(H)] [0] * W for i in range(H) for i in range(H) i range(H) range H for i in range(H) [0] * W [0] 0 W r = [[0] * W for i in range(H)] r [[0] * W for i in range(H)] [0] * W for i in range(H) for i in range(H) i range(H) range H for i in range(H) [0] * W [0] 0 W u = [[0] * W for i in range(H)] u [[0] * W for i in range(H)] [0] * W for i in range(H) for i in range(H) i range(H) range H for i in range(H) [0] * W [0] 0 W d= [[0] * W for i in range(H)] d [[0] * W for i in range(H)] for i in range(H):
    tmp =list(input())
    s.append(tmp) i range(H) range H tmp =list(input()) tmp list(input()) list input() input s.append(tmp) s.append s append tmp for y in range(H):
  for x in range(W):
    if s[y][x] == "#":
      continue
    elif x == 0:
      l[y][x] = 1
    else:
      l[y][x] = l[y][x-1] + 1 y range(H) range H for x in range(W):
    if s[y][x] == "#":
      continue
    elif x == 0:
      l[y][x] = 1
    else:
      l[y][x] = l[y][x-1] + 1 x range(W) range W if s[y][x] == "#":
      continue
    elif x == 0:
      l[y][x] = 1
    else:
      l[y][x] = l[y][x-1] + 1 s[y][x] == "#" s[y][x] [y] s y x "#" continue elif x == 0:
      l[y][x] = 1
     x == 0 x 0 l[y][x] = 1 l[y][x] [y] l y x 1 l[y][x] = l[y][x-1] + 1 l[y][x] [y] l y x l[y][x-1] + 1 l[y][x-1] [y] l y x-1 x 1 1 for y in range(H):
  for x in range(W-1, -1, -1):
    if s[y][x] == "#":
      continue
    elif x == W - 1:
      r[y][x] = 1
    else:
      r[y][x] = r[y][x+1] + 1
       y range(H) range H for x in range(W-1, -1, -1):
    if s[y][x] == "#":
      continue
    elif x == W - 1:
      r[y][x] = 1
    else:
      r[y][x] = r[y][x+1] + 1
       x range(W-1, -1, -1) range W-1 W 1 -1 -1 if s[y][x] == "#":
      continue
    elif x == W - 1:
      r[y][x] = 1
    else:
      r[y][x] = r[y][x+1] + 1
       s[y][x] == "#" s[y][x] [y] s y x "#" continue elif x == W - 1:
      r[y][x] = 1
     x == W - 1 x W - 1 W 1 r[y][x] = 1 r[y][x] [y] r y x 1 r[y][x] = r[y][x+1] + 1 r[y][x] [y] r y x r[y][x+1] + 1 r[y][x+1] [y] r y x+1 x 1 1 for y in range(H):
  for x in range(W):
    if s[y][x] == "#":
      continue
    elif y == 0:
      u[y][x] = 1
    else:
      u[y][x] = u[y-1][x] + 1
       y range(H) range H for x in range(W):
    if s[y][x] == "#":
      continue
    elif y == 0:
      u[y][x] = 1
    else:
      u[y][x] = u[y-1][x] + 1
       x range(W) range W if s[y][x] == "#":
      continue
    elif y == 0:
      u[y][x] = 1
    else:
      u[y][x] = u[y-1][x] + 1
       s[y][x] == "#" s[y][x] [y] s y x "#" continue elif y == 0:
      u[y][x] = 1
     y == 0 y 0 u[y][x] = 1 u[y][x] [y] u y x 1 u[y][x] = u[y-1][x] + 1 u[y][x] [y] u y x u[y-1][x] + 1 u[y-1][x] [y-1] u y-1 y 1 x 1 for y in range(H-1, -1, -1):
  for x in range(W):
    if s[y][x] == "#":
      continue
    elif y == H - 1:
      d[y][x] = 1
    else:
      d[y][x] = d[y+1][x] + 1 y range(H-1, -1, -1) range H-1 H 1 -1 -1 for x in range(W):
    if s[y][x] == "#":
      continue
    elif y == H - 1:
      d[y][x] = 1
    else:
      d[y][x] = d[y+1][x] + 1 x range(W) range W if s[y][x] == "#":
      continue
    elif y == H - 1:
      d[y][x] = 1
    else:
      d[y][x] = d[y+1][x] + 1 s[y][x] == "#" s[y][x] [y] s y x "#" continue elif y == H - 1:
      d[y][x] = 1
     y == H - 1 y H - 1 H 1 d[y][x] = 1 d[y][x] [y] d y x 1 d[y][x] = d[y+1][x] + 1 d[y][x] [y] d y x d[y+1][x] + 1 d[y+1][x] [y+1] d y+1 y 1 x 1 ans = 0 ans 0 for x in range(H):
  for y in range(W):
    if ans < l[x][y] + r[x][y] + u[x][y] + d[x][y] - 3:
      ans = l[x][y] + r[x][y] + u[x][y] + d[x][y] - 3
       x range(H) range H for y in range(W):
    if ans < l[x][y] + r[x][y] + u[x][y] + d[x][y] - 3:
      ans = l[x][y] + r[x][y] + u[x][y] + d[x][y] - 3
       y range(W) range W if ans < l[x][y] + r[x][y] + u[x][y] + d[x][y] - 3:
      ans = l[x][y] + r[x][y] + u[x][y] + d[x][y] - 3
       ans < l[x][y] + r[x][y] + u[x][y] + d[x][y] - 3 ans l[x][y] + r[x][y] + u[x][y] + d[x][y] - 3 l[x][y] + r[x][y] + u[x][y] + d[x][y] l[x][y] + r[x][y] + u[x][y] l[x][y] + r[x][y] l[x][y] [x] l x y r[x][y] [x] r x y u[x][y] [x] u x y d[x][y] [x] d x y 3 ans = l[x][y] + r[x][y] + u[x][y] + d[x][y] - 3 ans l[x][y] + r[x][y] + u[x][y] + d[x][y] - 3 l[x][y] + r[x][y] + u[x][y] + d[x][y] l[x][y] + r[x][y] + u[x][y] l[x][y] + r[x][y] l[x][y] [x] l x y r[x][y] [x] r x y u[x][y] [x] u x y d[x][y] [x] d x y 3 print(ans) print ans d= [[0] * W for i in range(H)] [[0] * W for i in range(H)] d r = [[0] * W for i in range(H)] [[0] * W for i in range(H)] r l = [[0] * W for i in range(H)] [[0] * W for i in range(H)] l ans = l[x][y] + r[x][y] + u[x][y] + d[x][y] - 3 l[x][y] + r[x][y] + u[x][y] + d[x][y] - 3 ans ans = 0 0 ans u = [[0] * W for i in range(H)] [[0] * W for i in range(H)] u H,W = map(int,input().split()) map(int,input().split()) H s = [] [] s W = map(int,input().split()) map(int,input().split()) W tmp =list(input()) list(input()) tmp
H,W = map(int,input().split())

s = []
l = [[0] * W for i in range(H)]
r = [[0] * W for i in range(H)]
u = [[0] * W for i in range(H)]
d= [[0] * W for i in range(H)]
  
for i in range(H):
    tmp =list(input())
    s.append(tmp)

for y in range(H):
  for x in range(W):
    if s[y][x] == "#":
      continue
    elif x == 0:
      l[y][x] = 1
    else:
      l[y][x] = l[y][x-1] + 1

for y in range(H):
  for x in range(W-1, -1, -1):
    if s[y][x] == "#":
      continue
    elif x == W - 1:
      r[y][x] = 1
    else:
      r[y][x] = r[y][x+1] + 1
      
for y in range(H):
  for x in range(W):
    if s[y][x] == "#":
      continue
    elif y == 0:
      u[y][x] = 1
    else:
      u[y][x] = u[y-1][x] + 1
      
for y in range(H-1, -1, -1):
  for x in range(W):
    if s[y][x] == "#":
      continue
    elif y == H - 1:
      d[y][x] = 1
    else:
      d[y][x] = d[y+1][x] + 1

ans = 0
for x in range(H):
  for y in range(W):
    if ans < l[x][y] + r[x][y] + u[x][y] + d[x][y] - 3:
      ans = l[x][y] + r[x][y] + u[x][y] + d[x][y] - 3
      
print(ans)