import re
h,w = map(int, input().split())
m=[]
d = [[0]*w for _ in range(h)]
u = [[0]*w for _ in range(h)]
for _ in range(h):
  t=[]
  for i in re.split("(#)", input()):
    if not i == "#":
      t.extend([len(i)]*len(i))
    else:
      t.append(0)
  m.append(t)

for i in range(w):
  for j in range(h):
    if m[j][i] == 0:
      d[j][i] = 0
    else:
      if j != 0:
        d[j][i] = d[j-1][i] + 1
      else:
        d[j][i] = 1

    if m[h-1-j][i] == 0:
      u[h-1-j][i] = 0
    else:
      if h-1-j == h-1:
        u[h-1-j][i] = 1
      else:
        u[h-1-j][i] = u[h-j][i] + 1
ans=0
for i in range(w):
  for j in range(h):
    ans = max(ans, u[j][i]+d[j][i]+m[j][i])
print(ans - 2) import re re h,w = map(int, input().split()) h map(int, input().split()) map int input().split() ().split () input split w m=[] m [] [0]*w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0]*w [0] 0 w d = [[0]*w for _ in range(h)] d [[0]*w for _ in range(h)] [0]*w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0]*w [0] 0 w u = [[0]*w for _ in range(h)] u [[0]*w for _ in range(h)] for _ in range(h):
  t=[]
  for i in re.split("(#)", input()):
    if not i == "#":
      t.extend([len(i)]*len(i))
    else:
      t.append(0)
  m.append(t) _ range(h) range h t=[] t [] for i in re.split("(#)", input()):
    if not i == "#":
      t.extend([len(i)]*len(i))
    else:
      t.append(0)
   i re.split("(#)", input()) re.split re split "(#)" input() input if not i == "#":
      t.extend([len(i)]*len(i))
    else:
      t.append(0)
   not i == "#" i == "#" i "#" t.extend([len(i)]*len(i)) t.extend t extend [len(i)]*len(i) [len(i)] len(i) len i len(i) len i t.append(0) t.append t append 0 m.append(t) m.append m append t for i in range(w):
  for j in range(h):
    if m[j][i] == 0:
      d[j][i] = 0
    else:
      if j != 0:
        d[j][i] = d[j-1][i] + 1
      else:
        d[j][i] = 1

    if m[h-1-j][i] == 0:
      u[h-1-j][i] = 0
    else:
      if h-1-j == h-1:
        u[h-1-j][i] = 1
      else:
        u[h-1-j][i] = u[h-j][i] + 1 i range(w) range w for j in range(h):
    if m[j][i] == 0:
      d[j][i] = 0
    else:
      if j != 0:
        d[j][i] = d[j-1][i] + 1
      else:
        d[j][i] = 1

    if m[h-1-j][i] == 0:
      u[h-1-j][i] = 0
    else:
      if h-1-j == h-1:
        u[h-1-j][i] = 1
      else:
        u[h-1-j][i] = u[h-j][i] + 1 j range(h) range h if m[j][i] == 0:
      d[j][i] = 0
    else:
      if j != 0:
        d[j][i] = d[j-1][i] + 1
      else:
        d[j][i] = 1

     m[j][i] == 0 m[j][i] [j] m j i 0 d[j][i] = 0 d[j][i] [j] d j i 0 if j != 0:
        d[j][i] = d[j-1][i] + 1
      else:
        d[j][i] = 1

     j != 0 j 0 d[j][i] = d[j-1][i] + 1 d[j][i] [j] d j i d[j-1][i] + 1 d[j-1][i] [j-1] d j-1 j 1 i 1 d[j][i] = 1 d[j][i] [j] d j i 1 if m[h-1-j][i] == 0:
      u[h-1-j][i] = 0
    else:
      if h-1-j == h-1:
        u[h-1-j][i] = 1
      else:
        u[h-1-j][i] = u[h-j][i] + 1 m[h-1-j][i] == 0 m[h-1-j][i] [h-1-j] m h-1-j h-1 h 1 j i 0 u[h-1-j][i] = 0 u[h-1-j][i] [h-1-j] u h-1-j h-1 h 1 j i 0 if h-1-j == h-1:
        u[h-1-j][i] = 1
      else:
        u[h-1-j][i] = u[h-j][i] + 1 h-1-j == h-1 h-1-j h-1 h 1 j h-1 h 1 u[h-1-j][i] = 1 u[h-1-j][i] [h-1-j] u h-1-j h-1 h 1 j i 1 u[h-1-j][i] = u[h-j][i] + 1 u[h-1-j][i] [h-1-j] u h-1-j h-1 h 1 j i u[h-j][i] + 1 u[h-j][i] [h-j] u h-j h j i 1 ans=0 ans 0 for i in range(w):
  for j in range(h):
    ans = max(ans, u[j][i]+d[j][i]+m[j][i]) i range(w) range w for j in range(h):
    ans = max(ans, u[j][i]+d[j][i]+m[j][i]) j range(h) range h ans = max(ans, u[j][i]+d[j][i]+m[j][i]) ans max(ans, u[j][i]+d[j][i]+m[j][i]) max ans u[j][i]+d[j][i]+m[j][i] u[j][i]+d[j][i] u[j][i] [j] u j i d[j][i] [j] d j i m[j][i] [j] m j i print(ans - 2) print ans - 2 ans 2 ans = max(ans, u[j][i]+d[j][i]+m[j][i]) max(ans, u[j][i]+d[j][i]+m[j][i]) ans m=[] [] m t=[] [] t ans=0 0 ans w = map(int, input().split()) map(int, input().split()) w h,w = map(int, input().split()) map(int, input().split()) h d = [[0]*w for _ in range(h)] [[0]*w for _ in range(h)] d u = [[0]*w for _ in range(h)] [[0]*w for _ in range(h)] u
import re
h,w = map(int, input().split())
m=[]
d = [[0]*w for _ in range(h)]
u = [[0]*w for _ in range(h)]
for _ in range(h):
  t=[]
  for i in re.split("(#)", input()):
    if not i == "#":
      t.extend([len(i)]*len(i))
    else:
      t.append(0)
  m.append(t)

for i in range(w):
  for j in range(h):
    if m[j][i] == 0:
      d[j][i] = 0
    else:
      if j != 0:
        d[j][i] = d[j-1][i] + 1
      else:
        d[j][i] = 1

    if m[h-1-j][i] == 0:
      u[h-1-j][i] = 0
    else:
      if h-1-j == h-1:
        u[h-1-j][i] = 1
      else:
        u[h-1-j][i] = u[h-j][i] + 1
ans=0
for i in range(w):
  for j in range(h):
    ans = max(ans, u[j][i]+d[j][i]+m[j][i])
print(ans - 2)