H,W=map(int, input().split()) 
S=[[0 for _ in range(W+2)] for _ in range(H+2)]
for i in range(H):
  S[i+1]= ["#"] + list(input()) + ["#"]
for j in range(W+2):
  S[0][j]="#"
  S[-1][j]="#"
  
t=[[-1 for _ in range(W)] for _ in range(H)]
y=[[-1 for _ in range(W)] for _ in range(H)]

for i in range(H):
  for j in range(W):
    if S[i+1][j+1]==".":
      if t[i][j]==-1:
        k=1
        while True:
          if S[i+k+1][j+1]==".":
            k +=1
          else:
            break
        for l in range(k):
          t[i+l][j]=k       
      if y[i][j]==-1:
        m=1
        while True:
          if S[i+1][j+1+m]==".":
            m +=1
          else:
            break
        for n in range(m):
          y[i][j+n]=m       

maxi=0          
for i in range(H):
  for j in range(W):
    maxi=max(maxi, t[i][j]+y[i][j])
print(maxi-1) H,W=map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W [0 for _ in range(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 for _ in range(W+2)] S=[[0 for _ in range(W+2)] for _ in range(H+2)] S [[0 for _ in range(W+2)] for _ in range(H+2)] for i in range(H):
  S[i+1]= ["#"] + list(input()) + ["#"] i range(H) range H S[i+1]= ["#"] + list(input()) + ["#"] S[i+1] S i+1 i 1 ["#"] + list(input()) + ["#"] ["#"] + list(input()) ["#"] "#" list(input()) list input() input ["#"] "#" for j in range(W+2):
  S[0][j]="#"
  S[-1][j]="#"
   j range(W+2) range W+2 W 2 S[0][j]="#" S[0][j] [0] S 0 j "#" S[-1][j]="#" S[-1][j] [-1] S -1 j "#" [-1 for _ in range(W)] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [-1 for _ in range(W)] t=[[-1 for _ in range(W)] for _ in range(H)] t [[-1 for _ in range(W)] for _ in range(H)] [-1 for _ in range(W)] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [-1 for _ in range(W)] y=[[-1 for _ in range(W)] for _ in range(H)] y [[-1 for _ in range(W)] for _ in range(H)] for i in range(H):
  for j in range(W):
    if S[i+1][j+1]==".":
      if t[i][j]==-1:
        k=1
        while True:
          if S[i+k+1][j+1]==".":
            k +=1
          else:
            break
        for l in range(k):
          t[i+l][j]=k       
      if y[i][j]==-1:
        m=1
        while True:
          if S[i+1][j+1+m]==".":
            m +=1
          else:
            break
        for n in range(m):
          y[i][j+n]=m        i range(H) range H for j in range(W):
    if S[i+1][j+1]==".":
      if t[i][j]==-1:
        k=1
        while True:
          if S[i+k+1][j+1]==".":
            k +=1
          else:
            break
        for l in range(k):
          t[i+l][j]=k       
      if y[i][j]==-1:
        m=1
        while True:
          if S[i+1][j+1+m]==".":
            m +=1
          else:
            break
        for n in range(m):
          y[i][j+n]=m        j range(W) range W if S[i+1][j+1]==".":
      if t[i][j]==-1:
        k=1
        while True:
          if S[i+k+1][j+1]==".":
            k +=1
          else:
            break
        for l in range(k):
          t[i+l][j]=k       
      if y[i][j]==-1:
        m=1
        while True:
          if S[i+1][j+1+m]==".":
            m +=1
          else:
            break
        for n in range(m):
          y[i][j+n]=m        S[i+1][j+1]=="." S[i+1][j+1] [i+1] S i+1 i 1 j+1 j 1 "." if t[i][j]==-1:
        k=1
        while True:
          if S[i+k+1][j+1]==".":
            k +=1
          else:
            break
        for l in range(k):
          t[i+l][j]=k       
       t[i][j]==-1 t[i][j] [i] t i j -1 k=1 k 1 while True:
          if S[i+k+1][j+1]==".":
            k +=1
          else:
            break
         True if S[i+k+1][j+1]==".":
            k +=1
          else:
            break
         S[i+k+1][j+1]=="." S[i+k+1][j+1] [i+k+1] S i+k+1 i+k i k 1 j+1 j 1 "." k +=1 k 1 break for l in range(k):
          t[i+l][j]=k       
       l range(k) range k t[i+l][j]=k t[i+l][j] [i+l] t i+l i l j k if y[i][j]==-1:
        m=1
        while True:
          if S[i+1][j+1+m]==".":
            m +=1
          else:
            break
        for n in range(m):
          y[i][j+n]=m        y[i][j]==-1 y[i][j] [i] y i j -1 m=1 m 1 while True:
          if S[i+1][j+1+m]==".":
            m +=1
          else:
            break
         True if S[i+1][j+1+m]==".":
            m +=1
          else:
            break
         S[i+1][j+1+m]=="." S[i+1][j+1+m] [i+1] S i+1 i 1 j+1+m j+1 j 1 m "." m +=1 m 1 break for n in range(m):
          y[i][j+n]=m        n range(m) range m y[i][j+n]=m y[i][j+n] [i] y i j+n j n m maxi=0 maxi 0 for i in range(H):
  for j in range(W):
    maxi=max(maxi, t[i][j]+y[i][j]) i range(H) range H for j in range(W):
    maxi=max(maxi, t[i][j]+y[i][j]) j range(W) range W maxi=max(maxi, t[i][j]+y[i][j]) maxi max(maxi, t[i][j]+y[i][j]) max maxi t[i][j]+y[i][j] t[i][j] [i] t i j y[i][j] [i] y i j print(maxi-1) print maxi-1 maxi 1 S=[[0 for _ in range(W+2)] for _ in range(H+2)] [[0 for _ in range(W+2)] for _ in range(H+2)] S H,W=map(int, input().split()) map(int, input().split()) H k=1 1 k m +=1 1 m t=[[-1 for _ in range(W)] for _ in range(H)] [[-1 for _ in range(W)] for _ in range(H)] t m=1 1 m y=[[-1 for _ in range(W)] for _ in range(H)] [[-1 for _ in range(W)] for _ in range(H)] y maxi=max(maxi, t[i][j]+y[i][j]) max(maxi, t[i][j]+y[i][j]) maxi maxi=0 0 maxi W=map(int, input().split()) map(int, input().split()) W k +=1 1 k
H,W=map(int, input().split()) 
S=[[0 for _ in range(W+2)] for _ in range(H+2)]
for i in range(H):
  S[i+1]= ["#"] + list(input()) + ["#"]
for j in range(W+2):
  S[0][j]="#"
  S[-1][j]="#"
  
t=[[-1 for _ in range(W)] for _ in range(H)]
y=[[-1 for _ in range(W)] for _ in range(H)]

for i in range(H):
  for j in range(W):
    if S[i+1][j+1]==".":
      if t[i][j]==-1:
        k=1
        while True:
          if S[i+k+1][j+1]==".":
            k +=1
          else:
            break
        for l in range(k):
          t[i+l][j]=k       
      if y[i][j]==-1:
        m=1
        while True:
          if S[i+1][j+1+m]==".":
            m +=1
          else:
            break
        for n in range(m):
          y[i][j+n]=m       

maxi=0          
for i in range(H):
  for j in range(W):
    maxi=max(maxi, t[i][j]+y[i][j])
print(maxi-1)