import sys
sys.setrecursionlimit(2147483647)
 
h,w=map(int,input().split())
s=list(input() for _ in range(h))
 
yoko=[[0]*w for _ in range(h)]
tate=[[0]*w for _ in range(h)]
 
def yoko_check(y,x,cnt):
    global yoko,s
    if x==w-1:
        yoko[y][x]=cnt
        return cnt
    else:
        if s[y][x+1]=="#":
            yoko[y][x]=cnt
            return cnt
        else:
            yoko[y][x]=yoko_check(y,x+1,cnt+1)
            return yoko[y][x]
 
 
def tate_check(y,x,cnt):
    global tate,s
    if y==h-1:
        tate[y][x]=cnt
        return cnt
    else:
        if s[y+1][x]=="#":
            tate[y][x]=cnt
            return cnt
        else:
            tate[y][x]=tate_check(y+1,x,cnt+1)
            return tate[y][x]
 
 
for y in range(h):
    for x in range(w):
        if yoko[y][x]==0 and s[y][x]==".":
            yoko_check(y,x,1)
        if tate[y][x]==0 and s[y][x]==".":
            tate_check(y,x,1)
 
#print(tate)
 
result=0
for y in range(h):
    for x in range(w):
        if s[y][x]==".":
            result=max(result,tate[y][x]+yoko[y][x]-1)  
 
print(result)   import sys sys sys.setrecursionlimit(2147483647) sys.setrecursionlimit sys setrecursionlimit 2147483647 h,w=map(int,input().split()) h map(int,input().split()) map int input().split() ().split () input split w s=list(input() for _ in range(h)) s list(input() for _ in range(h)) list input() input [0]*w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0]*w [0] 0 w yoko=[[0]*w for _ in range(h)] yoko [[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 tate=[[0]*w for _ in range(h)] tate [[0]*w for _ in range(h)] def yoko_check(y,x,cnt):
    global yoko,s
    if x==w-1:
        yoko[y][x]=cnt
        return cnt
    else:
        if s[y][x+1]=="#":
            yoko[y][x]=cnt
            return cnt
        else:
            yoko[y][x]=yoko_check(y,x+1,cnt+1)
            return yoko[y][x]
 
  yoko_check global yoko,s if x==w-1:
        yoko[y][x]=cnt
        return cnt
    else:
        if s[y][x+1]=="#":
            yoko[y][x]=cnt
            return cnt
        else:
            yoko[y][x]=yoko_check(y,x+1,cnt+1)
            return yoko[y][x]
 
  x==w-1 x w-1 w 1 yoko[y][x]=cnt yoko[y][x] [y] yoko y x cnt return cnt cnt if s[y][x+1]=="#":
            yoko[y][x]=cnt
            return cnt
        else:
            yoko[y][x]=yoko_check(y,x+1,cnt+1)
            return yoko[y][x]
 
  s[y][x+1]=="#" s[y][x+1] [y] s y x+1 x 1 "#" yoko[y][x]=cnt yoko[y][x] [y] yoko y x cnt return cnt cnt yoko[y][x]=yoko_check(y,x+1,cnt+1) yoko[y][x] [y] yoko y x yoko_check(y,x+1,cnt+1) yoko_check y x+1 x 1 cnt+1 cnt 1 return yoko[y][x] yoko[y][x] [y] yoko y x y y x x cnt cnt def tate_check(y,x,cnt):
    global tate,s
    if y==h-1:
        tate[y][x]=cnt
        return cnt
    else:
        if s[y+1][x]=="#":
            tate[y][x]=cnt
            return cnt
        else:
            tate[y][x]=tate_check(y+1,x,cnt+1)
            return tate[y][x]
 
  tate_check global tate,s if y==h-1:
        tate[y][x]=cnt
        return cnt
    else:
        if s[y+1][x]=="#":
            tate[y][x]=cnt
            return cnt
        else:
            tate[y][x]=tate_check(y+1,x,cnt+1)
            return tate[y][x]
 
  y==h-1 y h-1 h 1 tate[y][x]=cnt tate[y][x] [y] tate y x cnt return cnt cnt if s[y+1][x]=="#":
            tate[y][x]=cnt
            return cnt
        else:
            tate[y][x]=tate_check(y+1,x,cnt+1)
            return tate[y][x]
 
  s[y+1][x]=="#" s[y+1][x] [y+1] s y+1 y 1 x "#" tate[y][x]=cnt tate[y][x] [y] tate y x cnt return cnt cnt tate[y][x]=tate_check(y+1,x,cnt+1) tate[y][x] [y] tate y x tate_check(y+1,x,cnt+1) tate_check y+1 y 1 x cnt+1 cnt 1 return tate[y][x] tate[y][x] [y] tate y x y y x x cnt cnt for y in range(h):
    for x in range(w):
        if yoko[y][x]==0 and s[y][x]==".":
            yoko_check(y,x,1)
        if tate[y][x]==0 and s[y][x]==".":
            tate_check(y,x,1)
 
#print(tate)
  y range(h) range h for x in range(w):
        if yoko[y][x]==0 and s[y][x]==".":
            yoko_check(y,x,1)
        if tate[y][x]==0 and s[y][x]==".":
            tate_check(y,x,1)
 
#print(tate)
  x range(w) range w if yoko[y][x]==0 and s[y][x]==".":
            yoko_check(y,x,1)
         yoko[y][x]==0 and s[y][x]=="." yoko[y][x]==0 yoko[y][x] [y] yoko y x 0 s[y][x]=="." s[y][x] [y] s y x "." yoko_check(y,x,1) yoko_check y x 1 if tate[y][x]==0 and s[y][x]==".":
            tate_check(y,x,1)
 
#print(tate)
  tate[y][x]==0 and s[y][x]=="." tate[y][x]==0 tate[y][x] [y] tate y x 0 s[y][x]=="." s[y][x] [y] s y x "." tate_check(y,x,1) tate_check y x 1 result=0 result 0 for y in range(h):
    for x in range(w):
        if s[y][x]==".":
            result=max(result,tate[y][x]+yoko[y][x]-1)  
  y range(h) range h for x in range(w):
        if s[y][x]==".":
            result=max(result,tate[y][x]+yoko[y][x]-1)  
  x range(w) range w if s[y][x]==".":
            result=max(result,tate[y][x]+yoko[y][x]-1)  
  s[y][x]=="." s[y][x] [y] s y x "." result=max(result,tate[y][x]+yoko[y][x]-1) result max(result,tate[y][x]+yoko[y][x]-1) max result tate[y][x]+yoko[y][x]-1 tate[y][x]+yoko[y][x] tate[y][x] [y] tate y x yoko[y][x] [y] yoko y x 1 print(result) print result tate=[[0]*w for _ in range(h)] [[0]*w for _ in range(h)] tate def yoko_check(y,x,cnt):
    global yoko,s
    if x==w-1:
        yoko[y][x]=cnt
        return cnt
    else:
        if s[y][x+1]=="#":
            yoko[y][x]=cnt
            return cnt
        else:
            yoko[y][x]=yoko_check(y,x+1,cnt+1)
            return yoko[y][x]
 
  def yoko_check(y,x,cnt):
    global yoko,s
    if x==w-1:
        yoko[y][x]=cnt
        return cnt
    else:
        if s[y][x+1]=="#":
            yoko[y][x]=cnt
            return cnt
        else:
            yoko[y][x]=yoko_check(y,x+1,cnt+1)
            return yoko[y][x]
 
  yoko_check result=0 0 result def tate_check(y,x,cnt):
    global tate,s
    if y==h-1:
        tate[y][x]=cnt
        return cnt
    else:
        if s[y+1][x]=="#":
            tate[y][x]=cnt
            return cnt
        else:
            tate[y][x]=tate_check(y+1,x,cnt+1)
            return tate[y][x]
 
  def tate_check(y,x,cnt):
    global tate,s
    if y==h-1:
        tate[y][x]=cnt
        return cnt
    else:
        if s[y+1][x]=="#":
            tate[y][x]=cnt
            return cnt
        else:
            tate[y][x]=tate_check(y+1,x,cnt+1)
            return tate[y][x]
 
  tate_check result=max(result,tate[y][x]+yoko[y][x]-1) max(result,tate[y][x]+yoko[y][x]-1) result yoko=[[0]*w for _ in range(h)] [[0]*w for _ in range(h)] yoko w=map(int,input().split()) map(int,input().split()) w h,w=map(int,input().split()) map(int,input().split()) h s=list(input() for _ in range(h)) list(input() for _ in range(h)) s
import sys
sys.setrecursionlimit(2147483647)
 
h,w=map(int,input().split())
s=list(input() for _ in range(h))
 
yoko=[[0]*w for _ in range(h)]
tate=[[0]*w for _ in range(h)]
 
def yoko_check(y,x,cnt):
    global yoko,s
    if x==w-1:
        yoko[y][x]=cnt
        return cnt
    else:
        if s[y][x+1]=="#":
            yoko[y][x]=cnt
            return cnt
        else:
            yoko[y][x]=yoko_check(y,x+1,cnt+1)
            return yoko[y][x]
 
 
def tate_check(y,x,cnt):
    global tate,s
    if y==h-1:
        tate[y][x]=cnt
        return cnt
    else:
        if s[y+1][x]=="#":
            tate[y][x]=cnt
            return cnt
        else:
            tate[y][x]=tate_check(y+1,x,cnt+1)
            return tate[y][x]
 
 
for y in range(h):
    for x in range(w):
        if yoko[y][x]==0 and s[y][x]==".":
            yoko_check(y,x,1)
        if tate[y][x]==0 and s[y][x]==".":
            tate_check(y,x,1)
 
#print(tate)
 
result=0
for y in range(h):
    for x in range(w):
        if s[y][x]==".":
            result=max(result,tate[y][x]+yoko[y][x]-1)  
 
print(result)  