h,w = map(int, input().split())
g = []
for _ in range(h):
  g.append(input())
l = [[0 for i in range(w)] for j in range(h)]
r = [[0 for i in range(w)] for j in range(h)]
d = [[0 for i in range(w)] for j in range(h)]
u = [[0 for i in range(w)] for j in range(h)]
for i in range(h):
  for j in range(w):
    if g[i][j] == '#':
      l[i][j] = 0
      u[i][j] = 0
    else:
      if j == 0:
        l[i][j] = 1
      else:
        l[i][j] = l[i][j-1]+1
      if i == 0:
        u[i][j] = 1
      else:
        u[i][j] = u[i-1][j]+1
for i in reversed(range(h)):
  for j in reversed(range(w)):
    if g[i][j] == '#':
      r[i][j] = 0
      d[i][j] = 0
    else:
      if j == w-1:
        r[i][j] = 1
      else:
        r[i][j] = r[i][j+1]+1
      if i == h-1:
        d[i][j] = 1
      else:
        d[i][j] = d[i+1][j]+1
ans = 0
for i in range(h):
  for j in range(w):
    ans = max(l[i][j]+r[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 g = [] g [] for _ in range(h):
  g.append(input()) _ range(h) range h g.append(input()) g.append g append input() input [0 for i in range(w)] for j in range(h) for j in range(h) j range(h) range h for j in range(h) [0 for i in range(w)] l = [[0 for i in range(w)] for j in range(h)] l [[0 for i in range(w)] for j in range(h)] [0 for i in range(w)] for j in range(h) for j in range(h) j range(h) range h for j in range(h) [0 for i in range(w)] r = [[0 for i in range(w)] for j in range(h)] r [[0 for i in range(w)] for j in range(h)] [0 for i in range(w)] for j in range(h) for j in range(h) j range(h) range h for j in range(h) [0 for i in range(w)] d = [[0 for i in range(w)] for j in range(h)] d [[0 for i in range(w)] for j in range(h)] [0 for i in range(w)] for j in range(h) for j in range(h) j range(h) range h for j in range(h) [0 for i in range(w)] u = [[0 for i in range(w)] for j in range(h)] u [[0 for i in range(w)] for j in range(h)] for i in range(h):
  for j in range(w):
    if g[i][j] == '#':
      l[i][j] = 0
      u[i][j] = 0
    else:
      if j == 0:
        l[i][j] = 1
      else:
        l[i][j] = l[i][j-1]+1
      if i == 0:
        u[i][j] = 1
      else:
        u[i][j] = u[i-1][j]+1 i range(h) range h for j in range(w):
    if g[i][j] == '#':
      l[i][j] = 0
      u[i][j] = 0
    else:
      if j == 0:
        l[i][j] = 1
      else:
        l[i][j] = l[i][j-1]+1
      if i == 0:
        u[i][j] = 1
      else:
        u[i][j] = u[i-1][j]+1 j range(w) range w if g[i][j] == '#':
      l[i][j] = 0
      u[i][j] = 0
    else:
      if j == 0:
        l[i][j] = 1
      else:
        l[i][j] = l[i][j-1]+1
      if i == 0:
        u[i][j] = 1
      else:
        u[i][j] = u[i-1][j]+1 g[i][j] == '#' g[i][j] [i] g i j '#' l[i][j] = 0 l[i][j] [i] l i j 0 u[i][j] = 0 u[i][j] [i] u i j 0 if j == 0:
        l[i][j] = 1
      else:
        l[i][j] = l[i][j-1]+1
       j == 0 j 0 l[i][j] = 1 l[i][j] [i] l i j 1 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 if i == 0:
        u[i][j] = 1
      else:
        u[i][j] = u[i-1][j]+1 i == 0 i 0 u[i][j] = 1 u[i][j] [i] u i j 1 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 reversed(range(h)):
  for j in reversed(range(w)):
    if g[i][j] == '#':
      r[i][j] = 0
      d[i][j] = 0
    else:
      if j == w-1:
        r[i][j] = 1
      else:
        r[i][j] = r[i][j+1]+1
      if i == h-1:
        d[i][j] = 1
      else:
        d[i][j] = d[i+1][j]+1 i reversed(range(h)) reversed range(h) range h for j in reversed(range(w)):
    if g[i][j] == '#':
      r[i][j] = 0
      d[i][j] = 0
    else:
      if j == w-1:
        r[i][j] = 1
      else:
        r[i][j] = r[i][j+1]+1
      if i == h-1:
        d[i][j] = 1
      else:
        d[i][j] = d[i+1][j]+1 j reversed(range(w)) reversed range(w) range w if g[i][j] == '#':
      r[i][j] = 0
      d[i][j] = 0
    else:
      if j == w-1:
        r[i][j] = 1
      else:
        r[i][j] = r[i][j+1]+1
      if i == h-1:
        d[i][j] = 1
      else:
        d[i][j] = d[i+1][j]+1 g[i][j] == '#' g[i][j] [i] g i j '#' r[i][j] = 0 r[i][j] [i] r i j 0 d[i][j] = 0 d[i][j] [i] d i j 0 if j == w-1:
        r[i][j] = 1
      else:
        r[i][j] = r[i][j+1]+1
       j == w-1 j w-1 w 1 r[i][j] = 1 r[i][j] [i] r i j 1 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 if i == h-1:
        d[i][j] = 1
      else:
        d[i][j] = d[i+1][j]+1 i == h-1 i h-1 h 1 d[i][j] = 1 d[i][j] [i] d i j 1 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(h):
  for j in range(w):
    ans = max(l[i][j]+r[i][j]+u[i][j]+d[i][j]-3,ans) i range(h) range h for j in range(w):
    ans = max(l[i][j]+r[i][j]+u[i][j]+d[i][j]-3,ans) j range(w) range w ans = max(l[i][j]+r[i][j]+u[i][j]+d[i][j]-3,ans) ans max(l[i][j]+r[i][j]+u[i][j]+d[i][j]-3,ans) max l[i][j]+r[i][j]+u[i][j]+d[i][j]-3 l[i][j]+r[i][j]+u[i][j]+d[i][j] l[i][j]+r[i][j]+u[i][j] l[i][j]+r[i][j] l[i][j] [i] l i j r[i][j] [i] r i j u[i][j] [i] u i j d[i][j] [i] d i j 3 ans print(ans) print ans u = [[0 for i in range(w)] for j in range(h)] [[0 for i in range(w)] for j in range(h)] u r = [[0 for i in range(w)] for j in range(h)] [[0 for i in range(w)] for j in range(h)] r ans = 0 0 ans w = map(int, input().split()) map(int, input().split()) w ans = max(l[i][j]+r[i][j]+u[i][j]+d[i][j]-3,ans) max(l[i][j]+r[i][j]+u[i][j]+d[i][j]-3,ans) ans h,w = map(int, input().split()) map(int, input().split()) h l = [[0 for i in range(w)] for j in range(h)] [[0 for i in range(w)] for j in range(h)] l d = [[0 for i in range(w)] for j in range(h)] [[0 for i in range(w)] for j in range(h)] d g = [] [] g
h,w = map(int, input().split())
g = []
for _ in range(h):
  g.append(input())
l = [[0 for i in range(w)] for j in range(h)]
r = [[0 for i in range(w)] for j in range(h)]
d = [[0 for i in range(w)] for j in range(h)]
u = [[0 for i in range(w)] for j in range(h)]
for i in range(h):
  for j in range(w):
    if g[i][j] == '#':
      l[i][j] = 0
      u[i][j] = 0
    else:
      if j == 0:
        l[i][j] = 1
      else:
        l[i][j] = l[i][j-1]+1
      if i == 0:
        u[i][j] = 1
      else:
        u[i][j] = u[i-1][j]+1
for i in reversed(range(h)):
  for j in reversed(range(w)):
    if g[i][j] == '#':
      r[i][j] = 0
      d[i][j] = 0
    else:
      if j == w-1:
        r[i][j] = 1
      else:
        r[i][j] = r[i][j+1]+1
      if i == h-1:
        d[i][j] = 1
      else:
        d[i][j] = d[i+1][j]+1
ans = 0
for i in range(h):
  for j in range(w):
    ans = max(l[i][j]+r[i][j]+u[i][j]+d[i][j]-3,ans)
print(ans)