h, w = map(int, input().split())
S = [list(input()) for _ in range(h)]

toUP = [[0] * w for _ in range(h)]
for i in range(w):
  cnt = 0
  for j in range(h):
    if S[j][i] == ".":
      cnt += 1
      toUP[j][i] = cnt
    else:
      cnt = 0

toDOWN = [[0] * w for _ in range(h)]
for i in range(w):
  cnt = 0
  for j in range(h - 1, -1, -1):
    if S[j][i] == ".":
      cnt += 1
      toDOWN[j][i] = cnt
    else:
      cnt = 0

toLEFT = [[0] * w for _ in range(h)]
for i in range(h):
  cnt = 0
  for j in range(w):
    if S[i][j] == ".":
      cnt += 1
      toLEFT[i][j] = cnt
    else:
      cnt = 0
    
toRIGHT = [[0] * w for _ in range(h)]
for i in range(h):
  cnt = 0
  for j in range(w - 1, -1, -1):
    if S[i][j] == ".":
      cnt += 1
      toRIGHT[i][j] = cnt
    else:
      cnt = 0

ans = 0
for i in range(h):
  for j in range(w):
    if S[i][j] == ".":
      ans = max(ans, toUP[i][j] + toDOWN[i][j] + toLEFT[i][j] + toRIGHT[i][j] - 3)
print(ans) 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 S = [list(input()) for _ in range(h)] S [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 toUP = [[0] * w for _ in range(h)] toUP [[0] * w for _ in range(h)] for i in range(w):
  cnt = 0
  for j in range(h):
    if S[j][i] == ".":
      cnt += 1
      toUP[j][i] = cnt
    else:
      cnt = 0 i range(w) range w cnt = 0 cnt 0 for j in range(h):
    if S[j][i] == ".":
      cnt += 1
      toUP[j][i] = cnt
    else:
      cnt = 0 j range(h) range h if S[j][i] == ".":
      cnt += 1
      toUP[j][i] = cnt
    else:
      cnt = 0 S[j][i] == "." S[j][i] [j] S j i "." cnt += 1 cnt 1 toUP[j][i] = cnt toUP[j][i] [j] toUP j i cnt cnt = 0 cnt 0 [0] * w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0] * w [0] 0 w toDOWN = [[0] * w for _ in range(h)] toDOWN [[0] * w for _ in range(h)] for i in range(w):
  cnt = 0
  for j in range(h - 1, -1, -1):
    if S[j][i] == ".":
      cnt += 1
      toDOWN[j][i] = cnt
    else:
      cnt = 0 i range(w) range w cnt = 0 cnt 0 for j in range(h - 1, -1, -1):
    if S[j][i] == ".":
      cnt += 1
      toDOWN[j][i] = cnt
    else:
      cnt = 0 j range(h - 1, -1, -1) range h - 1 h 1 -1 -1 if S[j][i] == ".":
      cnt += 1
      toDOWN[j][i] = cnt
    else:
      cnt = 0 S[j][i] == "." S[j][i] [j] S j i "." cnt += 1 cnt 1 toDOWN[j][i] = cnt toDOWN[j][i] [j] toDOWN j i cnt cnt = 0 cnt 0 [0] * w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0] * w [0] 0 w toLEFT = [[0] * w for _ in range(h)] toLEFT [[0] * w for _ in range(h)] for i in range(h):
  cnt = 0
  for j in range(w):
    if S[i][j] == ".":
      cnt += 1
      toLEFT[i][j] = cnt
    else:
      cnt = 0
     i range(h) range h cnt = 0 cnt 0 for j in range(w):
    if S[i][j] == ".":
      cnt += 1
      toLEFT[i][j] = cnt
    else:
      cnt = 0
     j range(w) range w if S[i][j] == ".":
      cnt += 1
      toLEFT[i][j] = cnt
    else:
      cnt = 0
     S[i][j] == "." S[i][j] [i] S i j "." cnt += 1 cnt 1 toLEFT[i][j] = cnt toLEFT[i][j] [i] toLEFT i j cnt cnt = 0 cnt 0 [0] * w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0] * w [0] 0 w toRIGHT = [[0] * w for _ in range(h)] toRIGHT [[0] * w for _ in range(h)] for i in range(h):
  cnt = 0
  for j in range(w - 1, -1, -1):
    if S[i][j] == ".":
      cnt += 1
      toRIGHT[i][j] = cnt
    else:
      cnt = 0 i range(h) range h cnt = 0 cnt 0 for j in range(w - 1, -1, -1):
    if S[i][j] == ".":
      cnt += 1
      toRIGHT[i][j] = cnt
    else:
      cnt = 0 j range(w - 1, -1, -1) range w - 1 w 1 -1 -1 if S[i][j] == ".":
      cnt += 1
      toRIGHT[i][j] = cnt
    else:
      cnt = 0 S[i][j] == "." S[i][j] [i] S i j "." cnt += 1 cnt 1 toRIGHT[i][j] = cnt toRIGHT[i][j] [i] toRIGHT i j cnt cnt = 0 cnt 0 ans = 0 ans 0 for i in range(h):
  for j in range(w):
    if S[i][j] == ".":
      ans = max(ans, toUP[i][j] + toDOWN[i][j] + toLEFT[i][j] + toRIGHT[i][j] - 3) i range(h) range h for j in range(w):
    if S[i][j] == ".":
      ans = max(ans, toUP[i][j] + toDOWN[i][j] + toLEFT[i][j] + toRIGHT[i][j] - 3) j range(w) range w if S[i][j] == ".":
      ans = max(ans, toUP[i][j] + toDOWN[i][j] + toLEFT[i][j] + toRIGHT[i][j] - 3) S[i][j] == "." S[i][j] [i] S i j "." ans = max(ans, toUP[i][j] + toDOWN[i][j] + toLEFT[i][j] + toRIGHT[i][j] - 3) ans max(ans, toUP[i][j] + toDOWN[i][j] + toLEFT[i][j] + toRIGHT[i][j] - 3) max ans toUP[i][j] + toDOWN[i][j] + toLEFT[i][j] + toRIGHT[i][j] - 3 toUP[i][j] + toDOWN[i][j] + toLEFT[i][j] + toRIGHT[i][j] toUP[i][j] + toDOWN[i][j] + toLEFT[i][j] toUP[i][j] + toDOWN[i][j] toUP[i][j] [i] toUP i j toDOWN[i][j] [i] toDOWN i j toLEFT[i][j] [i] toLEFT i j toRIGHT[i][j] [i] toRIGHT i j 3 print(ans) print ans toDOWN = [[0] * w for _ in range(h)] [[0] * w for _ in range(h)] toDOWN w = map(int, input().split()) map(int, input().split()) w cnt = 0 0 cnt cnt = 0 0 cnt toRIGHT = [[0] * w for _ in range(h)] [[0] * w for _ in range(h)] toRIGHT S = [list(input()) for _ in range(h)] [list(input()) for _ in range(h)] S cnt = 0 0 cnt cnt = 0 0 cnt cnt = 0 0 cnt ans = max(ans, toUP[i][j] + toDOWN[i][j] + toLEFT[i][j] + toRIGHT[i][j] - 3) max(ans, toUP[i][j] + toDOWN[i][j] + toLEFT[i][j] + toRIGHT[i][j] - 3) ans cnt = 0 0 cnt cnt += 1 1 cnt toLEFT = [[0] * w for _ in range(h)] [[0] * w for _ in range(h)] toLEFT cnt += 1 1 cnt h, w = map(int, input().split()) map(int, input().split()) h ans = 0 0 ans cnt = 0 0 cnt toUP = [[0] * w for _ in range(h)] [[0] * w for _ in range(h)] toUP cnt += 1 1 cnt cnt += 1 1 cnt cnt = 0 0 cnt
h, w = map(int, input().split())
S = [list(input()) for _ in range(h)]

toUP = [[0] * w for _ in range(h)]
for i in range(w):
  cnt = 0
  for j in range(h):
    if S[j][i] == ".":
      cnt += 1
      toUP[j][i] = cnt
    else:
      cnt = 0

toDOWN = [[0] * w for _ in range(h)]
for i in range(w):
  cnt = 0
  for j in range(h - 1, -1, -1):
    if S[j][i] == ".":
      cnt += 1
      toDOWN[j][i] = cnt
    else:
      cnt = 0

toLEFT = [[0] * w for _ in range(h)]
for i in range(h):
  cnt = 0
  for j in range(w):
    if S[i][j] == ".":
      cnt += 1
      toLEFT[i][j] = cnt
    else:
      cnt = 0
    
toRIGHT = [[0] * w for _ in range(h)]
for i in range(h):
  cnt = 0
  for j in range(w - 1, -1, -1):
    if S[i][j] == ".":
      cnt += 1
      toRIGHT[i][j] = cnt
    else:
      cnt = 0

ans = 0
for i in range(h):
  for j in range(w):
    if S[i][j] == ".":
      ans = max(ans, toUP[i][j] + toDOWN[i][j] + toLEFT[i][j] + toRIGHT[i][j] - 3)
print(ans)
