h,w=map(int,input().split())
f=lambda:[[0]*w for _ in range(h)]
g=[input() for _ in range(h)]
l,r=f(),f()
for i in range(h):
  lc=rc=0
  for j in range(w):
    if g[i][j]=='.': lc+=1; l[i][j]=lc
    else: lc=0
    if g[i][-1-j]=='.': rc+=1; r[i][-1-j]=rc
    else: rc=0
d,u=f(),f()
for i in range(w):
  dc=uc=0
  for j in range(h):
    if g[j][i]=='.': dc+=1; d[j][i]=dc
    else: dc=0
    if g[-1-j][i]=='.': uc+=1; u[-1-j][i]=uc
    else: uc=0
print(max(l[i][j]+r[i][j]+d[i][j]+u[i][j]-3 for i in range(h) for j in range(w))) h,w=map(int,input().split()) h map(int,input().split()) map int input().split() ().split () input split w [0]*w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0]*w [0] 0 w f=lambda:[[0]*w for _ in range(h)] f lambda:[[0]*w for _ in range(h)] [[0]*w for _ in range(h)] input() for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) input() input g=[input() for _ in range(h)] g [input() for _ in range(h)] l,r=f(),f() l f() f r f() f for i in range(h):
  lc=rc=0
  for j in range(w):
    if g[i][j]=='.': lc+=1; l[i][j]=lc
    else: lc=0
    if g[i][-1-j]=='.': rc+=1; r[i][-1-j]=rc
    else: rc=0 i range(h) range h lc=rc=0 lc 0 =rc=0 rc 0 for j in range(w):
    if g[i][j]=='.': lc+=1; l[i][j]=lc
    else: lc=0
    if g[i][-1-j]=='.': rc+=1; r[i][-1-j]=rc
    else: rc=0 j range(w) range w if g[i][j]=='.': lc+=1; l[i][j]=lc
    else: lc=0
     g[i][j]=='.' g[i][j] [i] g i j '.' if g[i][-1-j]=='.': rc+=1; r[i][-1-j]=rc
    else: rc=0 g[i][-1-j]=='.' g[i][-1-j] [i] g i -1-j -1 j '.' d,u=f(),f() d f() f u f() f for i in range(w):
  dc=uc=0
  for j in range(h):
    if g[j][i]=='.': dc+=1; d[j][i]=dc
    else: dc=0
    if g[-1-j][i]=='.': uc+=1; u[-1-j][i]=uc
    else: uc=0 i range(w) range w dc=uc=0 dc 0 =uc=0 uc 0 for j in range(h):
    if g[j][i]=='.': dc+=1; d[j][i]=dc
    else: dc=0
    if g[-1-j][i]=='.': uc+=1; u[-1-j][i]=uc
    else: uc=0 j range(h) range h if g[j][i]=='.': dc+=1; d[j][i]=dc
    else: dc=0
     g[j][i]=='.' g[j][i] [j] g j i '.' if g[-1-j][i]=='.': uc+=1; u[-1-j][i]=uc
    else: uc=0 g[-1-j][i]=='.' g[-1-j][i] [-1-j] g -1-j -1 j i '.' print(max(l[i][j]+r[i][j]+d[i][j]+u[i][j]-3 for i in range(h) for j in range(w))) print max(l[i][j]+r[i][j]+d[i][j]+u[i][j]-3 for i in range(h) for j in range(w)) max l[i][j]+r[i][j]+d[i][j]+u[i][j]-3 l[i][j]+r[i][j]+d[i][j]+u[i][j] l[i][j]+r[i][j]+d[i][j] l[i][j]+r[i][j] l[i][j] [i] l i j r[i][j] [i] r i j d[i][j] [i] d i j u[i][j] [i] u i j 3 l,r=f(),f() f() l f=lambda:[[0]*w for _ in range(h)] lambda:[[0]*w for _ in range(h)] f w=map(int,input().split()) map(int,input().split()) w lc=rc=0 0 lc d,u=f(),f() f() d g=[input() for _ in range(h)] [input() for _ in range(h)] g rc=0 0 rc h,w=map(int,input().split()) map(int,input().split()) h dc=uc=0 0 dc uc=0 0 uc r=f(),f() f() r u=f(),f() f() u
h,w=map(int,input().split())
f=lambda:[[0]*w for _ in range(h)]
g=[input() for _ in range(h)]
l,r=f(),f()
for i in range(h):
  lc=rc=0
  for j in range(w):
    if g[i][j]=='.': lc+=1; l[i][j]=lc
    else: lc=0
    if g[i][-1-j]=='.': rc+=1; r[i][-1-j]=rc
    else: rc=0
d,u=f(),f()
for i in range(w):
  dc=uc=0
  for j in range(h):
    if g[j][i]=='.': dc+=1; d[j][i]=dc
    else: dc=0
    if g[-1-j][i]=='.': uc+=1; u[-1-j][i]=uc
    else: uc=0
print(max(l[i][j]+r[i][j]+d[i][j]+u[i][j]-3 for i in range(h) for j in range(w)))