h,w=map(int,input().split())
s=[]
s.append("#"*(w+2))
for i in range(h):
  s.append("#"+input()+"#")
s.append("#"*(w+2))
r=[[0]*(w+2) for i in range(h+2)]
l=[[0]*(w+2) for i in range(h+2)]
d=[[0]*(w+2) for i in range(h+2)]
u=[[0]*(w+2) for i in range(h+2)]

for i in range(1,h+1):
  for j in range(w+1,0,-1):
    if s[i][j]=="#":
      r[i][j]=0
    else:
      r[i][j]+=r[i][j+1]+1
# print(r)
for i in range(1,h+1):
  for j in range(1,w+1):
    if s[i][j]=="#":
      l[i][j]=0
    else:
      l[i][j]+=l[i][j-1]+1
# print(l)
for i in range(1,h+1):
  for j in range(1,w+1):
    if s[i][j]=="#":
      u[i][j]=0
    else:
      u[i][j]+=u[i-1][j]+1
# print(u)
for i in range(h+1,0,-1):
  for j in range(1,w+1):
    if s[i][j]=="#":
      d[i][j]=0
    else:
      d[i][j]+=d[i+1][j]+1
# print(d)
ans=0
for i in range(1,h+1):
  for j in range(1,w+1):
    ans=max(r[i][j]+l[i][j]+u[i][j]+d[i][j]-3,ans)
print(ans) h,w=map(int,input().split()) h map(int,input().split()) map int input().split() ().split () input split w s=[] s [] s.append("#"*(w+2)) s.append s append "#"*(w+2) "#" w+2 w 2 for i in range(h):
  s.append("#"+input()+"#") i range(h) range h s.append("#"+input()+"#") s.append s append "#"+input()+"#" "#"+input() "#" input() input "#" s.append("#"*(w+2)) s.append s append "#"*(w+2) "#" w+2 w 2 [0]*(w+2) for i in range(h+2) for i in range(h+2) i range(h+2) range h+2 h 2 for i in range(h+2) [0]*(w+2) [0] 0 w+2 w 2 r=[[0]*(w+2) for i in range(h+2)] r [[0]*(w+2) for i in range(h+2)] [0]*(w+2) for i in range(h+2) for i in range(h+2) i range(h+2) range h+2 h 2 for i in range(h+2) [0]*(w+2) [0] 0 w+2 w 2 l=[[0]*(w+2) for i in range(h+2)] l [[0]*(w+2) for i in range(h+2)] [0]*(w+2) for i in range(h+2) for i in range(h+2) i range(h+2) range h+2 h 2 for i in range(h+2) [0]*(w+2) [0] 0 w+2 w 2 d=[[0]*(w+2) for i in range(h+2)] d [[0]*(w+2) for i in range(h+2)] [0]*(w+2) for i in range(h+2) for i in range(h+2) i range(h+2) range h+2 h 2 for i in range(h+2) [0]*(w+2) [0] 0 w+2 w 2 u=[[0]*(w+2) for i in range(h+2)] u [[0]*(w+2) for i in range(h+2)] for i in range(1,h+1):
  for j in range(w+1,0,-1):
    if s[i][j]=="#":
      r[i][j]=0
    else:
      r[i][j]+=r[i][j+1]+1
# print(r) i range(1,h+1) range 1 h+1 h 1 for j in range(w+1,0,-1):
    if s[i][j]=="#":
      r[i][j]=0
    else:
      r[i][j]+=r[i][j+1]+1
# print(r) j range(w+1,0,-1) range w+1 w 1 0 -1 if s[i][j]=="#":
      r[i][j]=0
    else:
      r[i][j]+=r[i][j+1]+1
# print(r) s[i][j]=="#" s[i][j] [i] s i j "#" r[i][j]=0 r[i][j] [i] r i j 0 r[i][j]+=r[i][j+1]+1 r[i][j] [i] r i j r[i][j+1]+1 r[i][j+1] [i] r i j+1 j 1 1 for i in range(1,h+1):
  for j in range(1,w+1):
    if s[i][j]=="#":
      l[i][j]=0
    else:
      l[i][j]+=l[i][j-1]+1
# print(l) i range(1,h+1) range 1 h+1 h 1 for j in range(1,w+1):
    if s[i][j]=="#":
      l[i][j]=0
    else:
      l[i][j]+=l[i][j-1]+1
# print(l) j range(1,w+1) range 1 w+1 w 1 if s[i][j]=="#":
      l[i][j]=0
    else:
      l[i][j]+=l[i][j-1]+1
# print(l) s[i][j]=="#" s[i][j] [i] s i j "#" l[i][j]=0 l[i][j] [i] l i j 0 l[i][j]+=l[i][j-1]+1 l[i][j] [i] l i j l[i][j-1]+1 l[i][j-1] [i] l i j-1 j 1 1 for i in range(1,h+1):
  for j in range(1,w+1):
    if s[i][j]=="#":
      u[i][j]=0
    else:
      u[i][j]+=u[i-1][j]+1
# print(u) i range(1,h+1) range 1 h+1 h 1 for j in range(1,w+1):
    if s[i][j]=="#":
      u[i][j]=0
    else:
      u[i][j]+=u[i-1][j]+1
# print(u) j range(1,w+1) range 1 w+1 w 1 if s[i][j]=="#":
      u[i][j]=0
    else:
      u[i][j]+=u[i-1][j]+1
# print(u) s[i][j]=="#" s[i][j] [i] s i j "#" u[i][j]=0 u[i][j] [i] u i j 0 u[i][j]+=u[i-1][j]+1 u[i][j] [i] u i j u[i-1][j]+1 u[i-1][j] [i-1] u i-1 i 1 j 1 for i in range(h+1,0,-1):
  for j in range(1,w+1):
    if s[i][j]=="#":
      d[i][j]=0
    else:
      d[i][j]+=d[i+1][j]+1
# print(d) i range(h+1,0,-1) range h+1 h 1 0 -1 for j in range(1,w+1):
    if s[i][j]=="#":
      d[i][j]=0
    else:
      d[i][j]+=d[i+1][j]+1
# print(d) j range(1,w+1) range 1 w+1 w 1 if s[i][j]=="#":
      d[i][j]=0
    else:
      d[i][j]+=d[i+1][j]+1
# print(d) s[i][j]=="#" s[i][j] [i] s i j "#" d[i][j]=0 d[i][j] [i] d i j 0 d[i][j]+=d[i+1][j]+1 d[i][j] [i] d i j d[i+1][j]+1 d[i+1][j] [i+1] d i+1 i 1 j 1 ans=0 ans 0 for i in range(1,h+1):
  for j in range(1,w+1):
    ans=max(r[i][j]+l[i][j]+u[i][j]+d[i][j]-3,ans) i range(1,h+1) range 1 h+1 h 1 for j in range(1,w+1):
    ans=max(r[i][j]+l[i][j]+u[i][j]+d[i][j]-3,ans) j range(1,w+1) range 1 w+1 w 1 ans=max(r[i][j]+l[i][j]+u[i][j]+d[i][j]-3,ans) ans max(r[i][j]+l[i][j]+u[i][j]+d[i][j]-3,ans) max r[i][j]+l[i][j]+u[i][j]+d[i][j]-3 r[i][j]+l[i][j]+u[i][j]+d[i][j] r[i][j]+l[i][j]+u[i][j] r[i][j]+l[i][j] r[i][j] [i] r i j l[i][j] [i] l i j u[i][j] [i] u i j d[i][j] [i] d i j 3 ans print(ans) print ans r=[[0]*(w+2) for i in range(h+2)] [[0]*(w+2) for i in range(h+2)] r w=map(int,input().split()) map(int,input().split()) w s=[] [] s u=[[0]*(w+2) for i in range(h+2)] [[0]*(w+2) for i in range(h+2)] u h,w=map(int,input().split()) map(int,input().split()) h ans=0 0 ans l=[[0]*(w+2) for i in range(h+2)] [[0]*(w+2) for i in range(h+2)] l d=[[0]*(w+2) for i in range(h+2)] [[0]*(w+2) for i in range(h+2)] d ans=max(r[i][j]+l[i][j]+u[i][j]+d[i][j]-3,ans) max(r[i][j]+l[i][j]+u[i][j]+d[i][j]-3,ans) ans
h,w=map(int,input().split())
s=[]
s.append("#"*(w+2))
for i in range(h):
  s.append("#"+input()+"#")
s.append("#"*(w+2))
r=[[0]*(w+2) for i in range(h+2)]
l=[[0]*(w+2) for i in range(h+2)]
d=[[0]*(w+2) for i in range(h+2)]
u=[[0]*(w+2) for i in range(h+2)]

for i in range(1,h+1):
  for j in range(w+1,0,-1):
    if s[i][j]=="#":
      r[i][j]=0
    else:
      r[i][j]+=r[i][j+1]+1
# print(r)
for i in range(1,h+1):
  for j in range(1,w+1):
    if s[i][j]=="#":
      l[i][j]=0
    else:
      l[i][j]+=l[i][j-1]+1
# print(l)
for i in range(1,h+1):
  for j in range(1,w+1):
    if s[i][j]=="#":
      u[i][j]=0
    else:
      u[i][j]+=u[i-1][j]+1
# print(u)
for i in range(h+1,0,-1):
  for j in range(1,w+1):
    if s[i][j]=="#":
      d[i][j]=0
    else:
      d[i][j]+=d[i+1][j]+1
# print(d)
ans=0
for i in range(1,h+1):
  for j in range(1,w+1):
    ans=max(r[i][j]+l[i][j]+u[i][j]+d[i][j]-3,ans)
print(ans)