#import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
#import heapq
#from fractions  import gcd
#input=sys.stdin.readline
import bisect
h,w=map(int,input().split())
s=[input() for _ in range(h)]
l=[[0]*w for _ in range(h)]
r=[[0]*w for _ in range(h)]
u=[[0]*w for _ in range(h)]
d=[[0]*w for _ in range(h)]

for i in range(h):
    for j in range(w):
        if s[i][j]=="#":
            l[i][j]=r[i][j]=u[i][j]=d[i][j]=0
        else: 
            l[i][j]=l[i][j-1]+1 if j!=0 else 1
            u[i][j]=u[i-1][j]+1 if i!=0 else 1
        if s[h-1-i][w-1-j]=="#":
            r[i][j]=d[i][j]=0
        else:
            r[i][j]=r[i][j-1]+1 if j!=0 else 1
            d[i][j]=d[i-1][j]+1 if i!=0 else 1
ans=0
for i in range(h):
    for j in range(w):
        res=l[i][j]+u[i][j]+r[h-1-i][w-1-j]+d[h-1-i][w-1-j]-3
        #print("##",i,j,"##",res)
        ans=max(res,ans)
print(ans) import math math import itertools itertools from collections import deque from collections import Counter import bisect bisect h,w=map(int,input().split()) h map(int,input().split()) map int input().split() ().split () input split w input() for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) input() input s=[input() for _ in range(h)] s [input() 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 l=[[0]*w for _ in range(h)] l [[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 r=[[0]*w for _ in range(h)] r [[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)] [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)] for i in range(h):
    for j in range(w):
        if s[i][j]=="#":
            l[i][j]=r[i][j]=u[i][j]=d[i][j]=0
        else: 
            l[i][j]=l[i][j-1]+1 if j!=0 else 1
            u[i][j]=u[i-1][j]+1 if i!=0 else 1
        if s[h-1-i][w-1-j]=="#":
            r[i][j]=d[i][j]=0
        else:
            r[i][j]=r[i][j-1]+1 if j!=0 else 1
            d[i][j]=d[i-1][j]+1 if i!=0 else 1 i range(h) range h for j in range(w):
        if s[i][j]=="#":
            l[i][j]=r[i][j]=u[i][j]=d[i][j]=0
        else: 
            l[i][j]=l[i][j-1]+1 if j!=0 else 1
            u[i][j]=u[i-1][j]+1 if i!=0 else 1
        if s[h-1-i][w-1-j]=="#":
            r[i][j]=d[i][j]=0
        else:
            r[i][j]=r[i][j-1]+1 if j!=0 else 1
            d[i][j]=d[i-1][j]+1 if i!=0 else 1 j range(w) range w if s[i][j]=="#":
            l[i][j]=r[i][j]=u[i][j]=d[i][j]=0
        else: 
            l[i][j]=l[i][j-1]+1 if j!=0 else 1
            u[i][j]=u[i-1][j]+1 if i!=0 else 1
         s[i][j]=="#" s[i][j] [i] s i j "#" l[i][j]=r[i][j]=u[i][j]=d[i][j]=0 l[i][j] [i] l i j 0 =r[i][j]=u[i][j]=d[i][j]=0 r[i][j] [i] r i j 0 u[i][j] [i] u i j d[i][j] [i] d i j l[i][j]=l[i][j-1]+1 if j!=0 else 1 l[i][j] [i] l i j l[i][j-1]+1 if j!=0 else 1 j!=0 j 0 l[i][j-1]+1 l[i][j-1] [i] l i j-1 j 1 1 1 u[i][j]=u[i-1][j]+1 if i!=0 else 1 u[i][j] [i] u i j u[i-1][j]+1 if i!=0 else 1 i!=0 i 0 u[i-1][j]+1 u[i-1][j] [i-1] u i-1 i 1 j 1 1 if s[h-1-i][w-1-j]=="#":
            r[i][j]=d[i][j]=0
        else:
            r[i][j]=r[i][j-1]+1 if j!=0 else 1
            d[i][j]=d[i-1][j]+1 if i!=0 else 1 s[h-1-i][w-1-j]=="#" s[h-1-i][w-1-j] [h-1-i] s h-1-i h-1 h 1 i w-1-j w-1 w 1 j "#" r[i][j]=d[i][j]=0 r[i][j] [i] r i j 0 =d[i][j]=0 d[i][j] [i] d i j 0 r[i][j]=r[i][j-1]+1 if j!=0 else 1 r[i][j] [i] r i j r[i][j-1]+1 if j!=0 else 1 j!=0 j 0 r[i][j-1]+1 r[i][j-1] [i] r i j-1 j 1 1 1 d[i][j]=d[i-1][j]+1 if i!=0 else 1 d[i][j] [i] d i j d[i-1][j]+1 if i!=0 else 1 i!=0 i 0 d[i-1][j]+1 d[i-1][j] [i-1] d i-1 i 1 j 1 1 ans=0 ans 0 for i in range(h):
    for j in range(w):
        res=l[i][j]+u[i][j]+r[h-1-i][w-1-j]+d[h-1-i][w-1-j]-3
        #print("##",i,j,"##",res)
        ans=max(res,ans) i range(h) range h for j in range(w):
        res=l[i][j]+u[i][j]+r[h-1-i][w-1-j]+d[h-1-i][w-1-j]-3
        #print("##",i,j,"##",res)
        ans=max(res,ans) j range(w) range w res=l[i][j]+u[i][j]+r[h-1-i][w-1-j]+d[h-1-i][w-1-j]-3 res l[i][j]+u[i][j]+r[h-1-i][w-1-j]+d[h-1-i][w-1-j]-3 l[i][j]+u[i][j]+r[h-1-i][w-1-j]+d[h-1-i][w-1-j] l[i][j]+u[i][j]+r[h-1-i][w-1-j] l[i][j]+u[i][j] l[i][j] [i] l i j u[i][j] [i] u i j r[h-1-i][w-1-j] [h-1-i] r h-1-i h-1 h 1 i w-1-j w-1 w 1 j d[h-1-i][w-1-j] [h-1-i] d h-1-i h-1 h 1 i w-1-j w-1 w 1 j 3 ans=max(res,ans) ans max(res,ans) max res ans print(ans) print ans h,w=map(int,input().split()) map(int,input().split()) h w=map(int,input().split()) map(int,input().split()) w s=[input() for _ in range(h)] [input() for _ in range(h)] s u=[[0]*w for _ in range(h)] [[0]*w for _ in range(h)] u d=[[0]*w for _ in range(h)] [[0]*w for _ in range(h)] d res=l[i][j]+u[i][j]+r[h-1-i][w-1-j]+d[h-1-i][w-1-j]-3 l[i][j]+u[i][j]+r[h-1-i][w-1-j]+d[h-1-i][w-1-j]-3 res ans=0 0 ans l=[[0]*w for _ in range(h)] [[0]*w for _ in range(h)] l r=[[0]*w for _ in range(h)] [[0]*w for _ in range(h)] r ans=max(res,ans) max(res,ans) ans
#import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
#import heapq
#from fractions  import gcd
#input=sys.stdin.readline
import bisect
h,w=map(int,input().split())
s=[input() for _ in range(h)]
l=[[0]*w for _ in range(h)]
r=[[0]*w for _ in range(h)]
u=[[0]*w for _ in range(h)]
d=[[0]*w for _ in range(h)]

for i in range(h):
    for j in range(w):
        if s[i][j]=="#":
            l[i][j]=r[i][j]=u[i][j]=d[i][j]=0
        else: 
            l[i][j]=l[i][j-1]+1 if j!=0 else 1
            u[i][j]=u[i-1][j]+1 if i!=0 else 1
        if s[h-1-i][w-1-j]=="#":
            r[i][j]=d[i][j]=0
        else:
            r[i][j]=r[i][j-1]+1 if j!=0 else 1
            d[i][j]=d[i-1][j]+1 if i!=0 else 1
ans=0
for i in range(h):
    for j in range(w):
        res=l[i][j]+u[i][j]+r[h-1-i][w-1-j]+d[h-1-i][w-1-j]-3
        #print("##",i,j,"##",res)
        ans=max(res,ans)
print(ans)