# import itertools
# import pprint
# import copy
# from collections import deque

h,w   = map(int,input().split())
mp    = list(list(input()) for i in range(h))
scx   = [[0 for _ in range(w)] for _ in range(h)]
scy   = [[0 for _ in range(w)] for _ in range(h)]
donex = [[0 for _ in range(w)] for _ in range(h)]
doney = [[0 for _ in range(w)] for _ in range(h)]
sc    = 0
ans   = 0

for y in range(h):
  for x in range(w):
    if mp[y][x]=='#':
      scx[y][x]==0
    elif donex[y][x]==1:
      continue
    else:
      l = 1
      while(x+l<w):
        if mp[y][x+l]=='#':
          break
        l += 1
      for i in range(l):
        scx[y][x+i] = l
        donex[y][x+i] = 1

for y in range(h):
  for x in range(w):
    if mp[y][x]=='#':
      scy[y][x]==0
    elif doney[y][x]==1:
      continue
    else:
      l = 1
      while(y+l<h):
        if mp[y+l][x]=='#':
          break
        l += 1
      for i in range(l):
        scy[y+i][x] = l
        doney[y+i][x] = 1

for y in range(h):
  for x in range(w):
    ans = max(ans, (scy[y][x] + scx[y][x] - 1))

print(ans) h,w   = map(int,input().split()) h map(int,input().split()) map int input().split() ().split () input split w mp    = list(list(input()) for i in range(h)) mp list(list(input()) for i in range(h)) list list(input()) list input() input [0 for _ in range(w)] for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0 for _ in range(w)] scx   = [[0 for _ in range(w)] for _ in range(h)] scx [[0 for _ in range(w)] for _ in range(h)] [0 for _ in range(w)] for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0 for _ in range(w)] scy   = [[0 for _ in range(w)] for _ in range(h)] scy [[0 for _ in range(w)] for _ in range(h)] [0 for _ in range(w)] for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0 for _ in range(w)] donex = [[0 for _ in range(w)] for _ in range(h)] donex [[0 for _ in range(w)] for _ in range(h)] [0 for _ in range(w)] for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0 for _ in range(w)] doney = [[0 for _ in range(w)] for _ in range(h)] doney [[0 for _ in range(w)] for _ in range(h)] sc    = 0 sc 0 ans   = 0 ans 0 for y in range(h):
  for x in range(w):
    if mp[y][x]=='#':
      scx[y][x]==0
    elif donex[y][x]==1:
      continue
    else:
      l = 1
      while(x+l<w):
        if mp[y][x+l]=='#':
          break
        l += 1
      for i in range(l):
        scx[y][x+i] = l
        donex[y][x+i] = 1 y range(h) range h for x in range(w):
    if mp[y][x]=='#':
      scx[y][x]==0
    elif donex[y][x]==1:
      continue
    else:
      l = 1
      while(x+l<w):
        if mp[y][x+l]=='#':
          break
        l += 1
      for i in range(l):
        scx[y][x+i] = l
        donex[y][x+i] = 1 x range(w) range w if mp[y][x]=='#':
      scx[y][x]==0
    elif donex[y][x]==1:
      continue
    else:
      l = 1
      while(x+l<w):
        if mp[y][x+l]=='#':
          break
        l += 1
      for i in range(l):
        scx[y][x+i] = l
        donex[y][x+i] = 1 mp[y][x]=='#' mp[y][x] [y] mp y x '#' scx[y][x]==0 scx[y][x] [y] scx y x 0 elif donex[y][x]==1:
      continue
     donex[y][x]==1 donex[y][x] [y] donex y x 1 continue l = 1 l 1 while(x+l<w):
        if mp[y][x+l]=='#':
          break
        l += 1
       x+l<w x+l x l w if mp[y][x+l]=='#':
          break
         mp[y][x+l]=='#' mp[y][x+l] [y] mp y x+l x l '#' break l += 1 l 1 for i in range(l):
        scx[y][x+i] = l
        donex[y][x+i] = 1 i range(l) range l scx[y][x+i] = l scx[y][x+i] [y] scx y x+i x i l donex[y][x+i] = 1 donex[y][x+i] [y] donex y x+i x i 1 for y in range(h):
  for x in range(w):
    if mp[y][x]=='#':
      scy[y][x]==0
    elif doney[y][x]==1:
      continue
    else:
      l = 1
      while(y+l<h):
        if mp[y+l][x]=='#':
          break
        l += 1
      for i in range(l):
        scy[y+i][x] = l
        doney[y+i][x] = 1 y range(h) range h for x in range(w):
    if mp[y][x]=='#':
      scy[y][x]==0
    elif doney[y][x]==1:
      continue
    else:
      l = 1
      while(y+l<h):
        if mp[y+l][x]=='#':
          break
        l += 1
      for i in range(l):
        scy[y+i][x] = l
        doney[y+i][x] = 1 x range(w) range w if mp[y][x]=='#':
      scy[y][x]==0
    elif doney[y][x]==1:
      continue
    else:
      l = 1
      while(y+l<h):
        if mp[y+l][x]=='#':
          break
        l += 1
      for i in range(l):
        scy[y+i][x] = l
        doney[y+i][x] = 1 mp[y][x]=='#' mp[y][x] [y] mp y x '#' scy[y][x]==0 scy[y][x] [y] scy y x 0 elif doney[y][x]==1:
      continue
     doney[y][x]==1 doney[y][x] [y] doney y x 1 continue l = 1 l 1 while(y+l<h):
        if mp[y+l][x]=='#':
          break
        l += 1
       y+l<h y+l y l h if mp[y+l][x]=='#':
          break
         mp[y+l][x]=='#' mp[y+l][x] [y+l] mp y+l y l x '#' break l += 1 l 1 for i in range(l):
        scy[y+i][x] = l
        doney[y+i][x] = 1 i range(l) range l scy[y+i][x] = l scy[y+i][x] [y+i] scy y+i y i x l doney[y+i][x] = 1 doney[y+i][x] [y+i] doney y+i y i x 1 for y in range(h):
  for x in range(w):
    ans = max(ans, (scy[y][x] + scx[y][x] - 1)) y range(h) range h for x in range(w):
    ans = max(ans, (scy[y][x] + scx[y][x] - 1)) x range(w) range w ans = max(ans, (scy[y][x] + scx[y][x] - 1)) ans max(ans, (scy[y][x] + scx[y][x] - 1)) max ans scy[y][x] + scx[y][x] - 1 scy[y][x] + scx[y][x] scy[y][x] [y] scy y x scx[y][x] [y] scx y x 1 print(ans) print ans donex = [[0 for _ in range(w)] for _ in range(h)] [[0 for _ in range(w)] for _ in range(h)] donex l = 1 1 l scy   = [[0 for _ in range(w)] for _ in range(h)] [[0 for _ in range(w)] for _ in range(h)] scy doney = [[0 for _ in range(w)] for _ in range(h)] [[0 for _ in range(w)] for _ in range(h)] doney sc    = 0 0 sc scx   = [[0 for _ in range(w)] for _ in range(h)] [[0 for _ in range(w)] for _ in range(h)] scx l = 1 1 l mp    = list(list(input()) for i in range(h)) list(list(input()) for i in range(h)) mp l += 1 1 l h,w   = map(int,input().split()) map(int,input().split()) h w   = map(int,input().split()) map(int,input().split()) w l += 1 1 l ans = max(ans, (scy[y][x] + scx[y][x] - 1)) max(ans, (scy[y][x] + scx[y][x] - 1)) ans ans   = 0 0 ans
# import itertools
# import pprint
# import copy
# from collections import deque

h,w   = map(int,input().split())
mp    = list(list(input()) for i in range(h))
scx   = [[0 for _ in range(w)] for _ in range(h)]
scy   = [[0 for _ in range(w)] for _ in range(h)]
donex = [[0 for _ in range(w)] for _ in range(h)]
doney = [[0 for _ in range(w)] for _ in range(h)]
sc    = 0
ans   = 0

for y in range(h):
  for x in range(w):
    if mp[y][x]=='#':
      scx[y][x]==0
    elif donex[y][x]==1:
      continue
    else:
      l = 1
      while(x+l<w):
        if mp[y][x+l]=='#':
          break
        l += 1
      for i in range(l):
        scx[y][x+i] = l
        donex[y][x+i] = 1

for y in range(h):
  for x in range(w):
    if mp[y][x]=='#':
      scy[y][x]==0
    elif doney[y][x]==1:
      continue
    else:
      l = 1
      while(y+l<h):
        if mp[y+l][x]=='#':
          break
        l += 1
      for i in range(l):
        scy[y+i][x] = l
        doney[y+i][x] = 1

for y in range(h):
  for x in range(w):
    ans = max(ans, (scy[y][x] + scx[y][x] - 1))

print(ans)