h, w = map(int, input().split())
s = []
for i in range(h):
  t = input()
  s.append(t)
yokol = [[0 for i in range(w)] for j in range(h)]
yokor = [[0 for i in range(w)] for j in range(h)]
tateu = [[0 for i in range(w)] for j in range(h)]
tated = [[0 for i in range(w)] for j in range(h)]

for i in range(h):
  cnt = 0
  for j in range(w):
    if s[i][j] == '#':
      cnt =0
    else:
      cnt += 1
      yokol[i][j] = cnt
  cnt = 0
  for j in reversed(range(w)):
    if s[i][j] == '#':
      cnt=0
    else:
      cnt += 1
      yokor[i][j] = cnt

for j in range(w):
  cnt = 0
  for i in range(h):
    if s[i][j] == '#':
      cnt =0
    else:
      cnt += 1
      tateu[i][j] = cnt
  cnt = 0
  for i in reversed(range(h)):
    if s[i][j] == '#':
      cnt =0
    else:
      cnt += 1
      tated[i][j] = cnt

ans = 0
for i in range(h):
  for j in range(w):
    x = yokol[i][j] + yokor[i][j] + tateu[i][j] + tated[i][j] - 3
    ans = max(ans,x)
print (ans) h, w = map(int, input().split()) h map(int, input().split()) map int input().split() ().split () input split w s = [] s [] for i in range(h):
  t = input()
  s.append(t) i range(h) range h t = input() t input() input s.append(t) s.append s append t [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)] yokol = [[0 for i in range(w)] for j in range(h)] yokol [[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)] yokor = [[0 for i in range(w)] for j in range(h)] yokor [[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)] tateu = [[0 for i in range(w)] for j in range(h)] tateu [[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)] tated = [[0 for i in range(w)] for j in range(h)] tated [[0 for i in range(w)] for j in range(h)] for i in range(h):
  cnt = 0
  for j in range(w):
    if s[i][j] == '#':
      cnt =0
    else:
      cnt += 1
      yokol[i][j] = cnt
  cnt = 0
  for j in reversed(range(w)):
    if s[i][j] == '#':
      cnt=0
    else:
      cnt += 1
      yokor[i][j] = cnt i range(h) range h cnt = 0 cnt 0 for j in range(w):
    if s[i][j] == '#':
      cnt =0
    else:
      cnt += 1
      yokol[i][j] = cnt
   j range(w) range w if s[i][j] == '#':
      cnt =0
    else:
      cnt += 1
      yokol[i][j] = cnt
   s[i][j] == '#' s[i][j] [i] s i j '#' cnt =0 cnt 0 cnt += 1 cnt 1 yokol[i][j] = cnt yokol[i][j] [i] yokol i j cnt cnt = 0 cnt 0 for j in reversed(range(w)):
    if s[i][j] == '#':
      cnt=0
    else:
      cnt += 1
      yokor[i][j] = cnt j reversed(range(w)) reversed range(w) range w if s[i][j] == '#':
      cnt=0
    else:
      cnt += 1
      yokor[i][j] = cnt s[i][j] == '#' s[i][j] [i] s i j '#' cnt=0 cnt 0 cnt += 1 cnt 1 yokor[i][j] = cnt yokor[i][j] [i] yokor i j cnt for j in range(w):
  cnt = 0
  for i in range(h):
    if s[i][j] == '#':
      cnt =0
    else:
      cnt += 1
      tateu[i][j] = cnt
  cnt = 0
  for i in reversed(range(h)):
    if s[i][j] == '#':
      cnt =0
    else:
      cnt += 1
      tated[i][j] = cnt j range(w) range w cnt = 0 cnt 0 for i in range(h):
    if s[i][j] == '#':
      cnt =0
    else:
      cnt += 1
      tateu[i][j] = cnt
   i range(h) range h if s[i][j] == '#':
      cnt =0
    else:
      cnt += 1
      tateu[i][j] = cnt
   s[i][j] == '#' s[i][j] [i] s i j '#' cnt =0 cnt 0 cnt += 1 cnt 1 tateu[i][j] = cnt tateu[i][j] [i] tateu i j cnt cnt = 0 cnt 0 for i in reversed(range(h)):
    if s[i][j] == '#':
      cnt =0
    else:
      cnt += 1
      tated[i][j] = cnt i reversed(range(h)) reversed range(h) range h if s[i][j] == '#':
      cnt =0
    else:
      cnt += 1
      tated[i][j] = cnt s[i][j] == '#' s[i][j] [i] s i j '#' cnt =0 cnt 0 cnt += 1 cnt 1 tated[i][j] = cnt tated[i][j] [i] tated i j cnt ans = 0 ans 0 for i in range(h):
  for j in range(w):
    x = yokol[i][j] + yokor[i][j] + tateu[i][j] + tated[i][j] - 3
    ans = max(ans,x) i range(h) range h for j in range(w):
    x = yokol[i][j] + yokor[i][j] + tateu[i][j] + tated[i][j] - 3
    ans = max(ans,x) j range(w) range w x = yokol[i][j] + yokor[i][j] + tateu[i][j] + tated[i][j] - 3 x yokol[i][j] + yokor[i][j] + tateu[i][j] + tated[i][j] - 3 yokol[i][j] + yokor[i][j] + tateu[i][j] + tated[i][j] yokol[i][j] + yokor[i][j] + tateu[i][j] yokol[i][j] + yokor[i][j] yokol[i][j] [i] yokol i j yokor[i][j] [i] yokor i j tateu[i][j] [i] tateu i j tated[i][j] [i] tated i j 3 ans = max(ans,x) ans max(ans,x) max ans x print (ans) print ans yokor = [[0 for i in range(w)] for j in range(h)] [[0 for i in range(w)] for j in range(h)] yokor cnt = 0 0 cnt cnt += 1 1 cnt h, w = map(int, input().split()) map(int, input().split()) h s = [] [] s tateu = [[0 for i in range(w)] for j in range(h)] [[0 for i in range(w)] for j in range(h)] tateu ans = 0 0 ans t = input() input() t cnt += 1 1 cnt cnt = 0 0 cnt cnt =0 0 cnt cnt += 1 1 cnt cnt += 1 1 cnt tated = [[0 for i in range(w)] for j in range(h)] [[0 for i in range(w)] for j in range(h)] tated cnt = 0 0 cnt cnt =0 0 cnt w = map(int, input().split()) map(int, input().split()) w x = yokol[i][j] + yokor[i][j] + tateu[i][j] + tated[i][j] - 3 yokol[i][j] + yokor[i][j] + tateu[i][j] + tated[i][j] - 3 x ans = max(ans,x) max(ans,x) ans yokol = [[0 for i in range(w)] for j in range(h)] [[0 for i in range(w)] for j in range(h)] yokol cnt = 0 0 cnt cnt =0 0 cnt cnt=0 0 cnt
h, w = map(int, input().split())
s = []
for i in range(h):
  t = input()
  s.append(t)
yokol = [[0 for i in range(w)] for j in range(h)]
yokor = [[0 for i in range(w)] for j in range(h)]
tateu = [[0 for i in range(w)] for j in range(h)]
tated = [[0 for i in range(w)] for j in range(h)]

for i in range(h):
  cnt = 0
  for j in range(w):
    if s[i][j] == '#':
      cnt =0
    else:
      cnt += 1
      yokol[i][j] = cnt
  cnt = 0
  for j in reversed(range(w)):
    if s[i][j] == '#':
      cnt=0
    else:
      cnt += 1
      yokor[i][j] = cnt

for j in range(w):
  cnt = 0
  for i in range(h):
    if s[i][j] == '#':
      cnt =0
    else:
      cnt += 1
      tateu[i][j] = cnt
  cnt = 0
  for i in reversed(range(h)):
    if s[i][j] == '#':
      cnt =0
    else:
      cnt += 1
      tated[i][j] = cnt

ans = 0
for i in range(h):
  for j in range(w):
    x = yokol[i][j] + yokor[i][j] + tateu[i][j] + tated[i][j] - 3
    ans = max(ans,x)
print (ans)