H, W = map(int, input().split())
S = []
l1 = []
for i in range(H):
  s = str(input())
  S.append(s)
  tmp = []
  cnt = 0
  flag = False
  for j in s:
    if flag:
      if j == '.':
        cnt += 1
      else:
        for k in range(cnt):
          tmp.append(cnt)
        cnt = 0
        tmp.append(0)
        flag = False
    else:
      if j == '.':
        flag = True
        cnt += 1
      else:
        tmp.append(0)
  if cnt > 0:
    for k in range(cnt):
      tmp.append(cnt)
  l1.append(tmp)

l2 = []
for i in range(W):
  tmp = []
  cnt = 0
  flag = False
  for j in range(H):
    x = S[j][i]
    if flag:
      if x == '.':
        cnt += 1
      else:
        for k in range(cnt):
          tmp.append(cnt)
        cnt = 0
        tmp.append(0)
        flag = False
    else:
      if x == '.':
        flag = True
        cnt += 1
      else:
        tmp.append(0)
  if cnt > 0:
    for k in range(cnt):
      tmp.append(cnt)
  l2.append(tmp)

ans = [[0]*W for i in range(H)]
m = 0
for i in range(H):
  for j in range(W):
    if (l1[i][j]>0) and (l2[j][i]>0):
      ans[i][j] = l1[i][j] + l2[j][i] - 1
    else:
      ans[i][j] = l1[i][j] + l2[j][i]
    m = max(m, ans[i][j])
print(m) H, W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W S = [] S [] l1 = [] l1 [] for i in range(H):
  s = str(input())
  S.append(s)
  tmp = []
  cnt = 0
  flag = False
  for j in s:
    if flag:
      if j == '.':
        cnt += 1
      else:
        for k in range(cnt):
          tmp.append(cnt)
        cnt = 0
        tmp.append(0)
        flag = False
    else:
      if j == '.':
        flag = True
        cnt += 1
      else:
        tmp.append(0)
  if cnt > 0:
    for k in range(cnt):
      tmp.append(cnt)
  l1.append(tmp) i range(H) range H s = str(input()) s str(input()) str input() input S.append(s) S.append S append s tmp = [] tmp [] cnt = 0 cnt 0 flag = False flag False for j in s:
    if flag:
      if j == '.':
        cnt += 1
      else:
        for k in range(cnt):
          tmp.append(cnt)
        cnt = 0
        tmp.append(0)
        flag = False
    else:
      if j == '.':
        flag = True
        cnt += 1
      else:
        tmp.append(0)
   j s if flag:
      if j == '.':
        cnt += 1
      else:
        for k in range(cnt):
          tmp.append(cnt)
        cnt = 0
        tmp.append(0)
        flag = False
    else:
      if j == '.':
        flag = True
        cnt += 1
      else:
        tmp.append(0)
   flag if j == '.':
        cnt += 1
      else:
        for k in range(cnt):
          tmp.append(cnt)
        cnt = 0
        tmp.append(0)
        flag = False
     j == '.' j '.' cnt += 1 cnt 1 for k in range(cnt):
          tmp.append(cnt)
         k range(cnt) range cnt tmp.append(cnt) tmp.append tmp append cnt cnt = 0 cnt 0 tmp.append(0) tmp.append tmp append 0 flag = False flag False if j == '.':
        flag = True
        cnt += 1
      else:
        tmp.append(0)
   j == '.' j '.' flag = True flag True cnt += 1 cnt 1 tmp.append(0) tmp.append tmp append 0 if cnt > 0:
    for k in range(cnt):
      tmp.append(cnt)
   cnt > 0 cnt 0 for k in range(cnt):
      tmp.append(cnt)
   k range(cnt) range cnt tmp.append(cnt) tmp.append tmp append cnt l1.append(tmp) l1.append l1 append tmp l2 = [] l2 [] for i in range(W):
  tmp = []
  cnt = 0
  flag = False
  for j in range(H):
    x = S[j][i]
    if flag:
      if x == '.':
        cnt += 1
      else:
        for k in range(cnt):
          tmp.append(cnt)
        cnt = 0
        tmp.append(0)
        flag = False
    else:
      if x == '.':
        flag = True
        cnt += 1
      else:
        tmp.append(0)
  if cnt > 0:
    for k in range(cnt):
      tmp.append(cnt)
  l2.append(tmp) i range(W) range W tmp = [] tmp [] cnt = 0 cnt 0 flag = False flag False for j in range(H):
    x = S[j][i]
    if flag:
      if x == '.':
        cnt += 1
      else:
        for k in range(cnt):
          tmp.append(cnt)
        cnt = 0
        tmp.append(0)
        flag = False
    else:
      if x == '.':
        flag = True
        cnt += 1
      else:
        tmp.append(0)
   j range(H) range H x = S[j][i] x S[j][i] [j] S j i if flag:
      if x == '.':
        cnt += 1
      else:
        for k in range(cnt):
          tmp.append(cnt)
        cnt = 0
        tmp.append(0)
        flag = False
    else:
      if x == '.':
        flag = True
        cnt += 1
      else:
        tmp.append(0)
   flag if x == '.':
        cnt += 1
      else:
        for k in range(cnt):
          tmp.append(cnt)
        cnt = 0
        tmp.append(0)
        flag = False
     x == '.' x '.' cnt += 1 cnt 1 for k in range(cnt):
          tmp.append(cnt)
         k range(cnt) range cnt tmp.append(cnt) tmp.append tmp append cnt cnt = 0 cnt 0 tmp.append(0) tmp.append tmp append 0 flag = False flag False if x == '.':
        flag = True
        cnt += 1
      else:
        tmp.append(0)
   x == '.' x '.' flag = True flag True cnt += 1 cnt 1 tmp.append(0) tmp.append tmp append 0 if cnt > 0:
    for k in range(cnt):
      tmp.append(cnt)
   cnt > 0 cnt 0 for k in range(cnt):
      tmp.append(cnt)
   k range(cnt) range cnt tmp.append(cnt) tmp.append tmp append cnt l2.append(tmp) l2.append l2 append tmp [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 ans = [[0]*W for i in range(H)] ans [[0]*W for i in range(H)] m = 0 m 0 for i in range(H):
  for j in range(W):
    if (l1[i][j]>0) and (l2[j][i]>0):
      ans[i][j] = l1[i][j] + l2[j][i] - 1
    else:
      ans[i][j] = l1[i][j] + l2[j][i]
    m = max(m, ans[i][j]) i range(H) range H for j in range(W):
    if (l1[i][j]>0) and (l2[j][i]>0):
      ans[i][j] = l1[i][j] + l2[j][i] - 1
    else:
      ans[i][j] = l1[i][j] + l2[j][i]
    m = max(m, ans[i][j]) j range(W) range W if (l1[i][j]>0) and (l2[j][i]>0):
      ans[i][j] = l1[i][j] + l2[j][i] - 1
    else:
      ans[i][j] = l1[i][j] + l2[j][i]
     (l1[i][j]>0) and (l2[j][i]>0) l1[i][j]>0 l1[i][j] [i] l1 i j 0 l2[j][i]>0 l2[j][i] [j] l2 j i 0 ans[i][j] = l1[i][j] + l2[j][i] - 1 ans[i][j] [i] ans i j l1[i][j] + l2[j][i] - 1 l1[i][j] + l2[j][i] l1[i][j] [i] l1 i j l2[j][i] [j] l2 j i 1 ans[i][j] = l1[i][j] + l2[j][i] ans[i][j] [i] ans i j l1[i][j] + l2[j][i] l1[i][j] [i] l1 i j l2[j][i] [j] l2 j i m = max(m, ans[i][j]) m max(m, ans[i][j]) max m ans[i][j] [i] ans i j print(m) print m cnt += 1 1 cnt l1 = [] [] l1 s = str(input()) str(input()) s m = 0 0 m x = S[j][i] S[j][i] x tmp = [] [] tmp S = [] [] S flag = False False flag cnt += 1 1 cnt cnt = 0 0 cnt cnt = 0 0 cnt flag = True True flag cnt += 1 1 cnt cnt += 1 1 cnt tmp = [] [] tmp cnt = 0 0 cnt m = max(m, ans[i][j]) max(m, ans[i][j]) m flag = False False flag ans = [[0]*W for i in range(H)] [[0]*W for i in range(H)] ans l2 = [] [] l2 flag = False False flag H, W = map(int, input().split()) map(int, input().split()) H flag = True True flag W = map(int, input().split()) map(int, input().split()) W flag = False False flag cnt = 0 0 cnt
H, W = map(int, input().split())
S = []
l1 = []
for i in range(H):
  s = str(input())
  S.append(s)
  tmp = []
  cnt = 0
  flag = False
  for j in s:
    if flag:
      if j == '.':
        cnt += 1
      else:
        for k in range(cnt):
          tmp.append(cnt)
        cnt = 0
        tmp.append(0)
        flag = False
    else:
      if j == '.':
        flag = True
        cnt += 1
      else:
        tmp.append(0)
  if cnt > 0:
    for k in range(cnt):
      tmp.append(cnt)
  l1.append(tmp)

l2 = []
for i in range(W):
  tmp = []
  cnt = 0
  flag = False
  for j in range(H):
    x = S[j][i]
    if flag:
      if x == '.':
        cnt += 1
      else:
        for k in range(cnt):
          tmp.append(cnt)
        cnt = 0
        tmp.append(0)
        flag = False
    else:
      if x == '.':
        flag = True
        cnt += 1
      else:
        tmp.append(0)
  if cnt > 0:
    for k in range(cnt):
      tmp.append(cnt)
  l2.append(tmp)

ans = [[0]*W for i in range(H)]
m = 0
for i in range(H):
  for j in range(W):
    if (l1[i][j]>0) and (l2[j][i]>0):
      ans[i][j] = l1[i][j] + l2[j][i] - 1
    else:
      ans[i][j] = l1[i][j] + l2[j][i]
    m = max(m, ans[i][j])
print(m)