h,w=map(int,input().split())

s=[['#']*(w+2)]
for i in range(h):
    s.append(['#']+list(input())+['#'])
s.append([['#']*(w+2)])

l=[[0]*(w+2) for _ in range(h+2)]
r=[[0]*(w+2) for _ in range(h+2)]
u=[[0]*(w+2) for _ in range(h+2)]
d=[[0]*(w+2) for _ in range(h+2)]

for i in range(1, h+1):
    for j in range(1, w+1):
        if s[i][j]=='.':
            l[i][j]=l[i][j-1]+1
            u[i][j]=u[i-1][j]+1
        if s[i][w+1-j]=='.':
            r[i][w+1-j]=r[i][w+2-j]+1
        if s[h+1-i][j]=='.':
            d[h+1-i][j]=d[h+2-i][j]+1

ans=0
for i in range(1, h+1):  # hはy座標
    for j in range(1, w+1):  # wはx座標
        tmp_ans=l[i][j]+r[i][j]+u[i][j]+d[i][j]-3
        ans=max(ans, tmp_ans)
print(ans) h,w=map(int,input().split()) h map(int,input().split()) map int input().split() ().split () input split w s=[['#']*(w+2)] s [['#']*(w+2)] ['#']*(w+2) ['#'] '#' w+2 w 2 for i in range(h):
    s.append(['#']+list(input())+['#']) i range(h) range h s.append(['#']+list(input())+['#']) s.append s append ['#']+list(input())+['#'] ['#']+list(input()) ['#'] '#' list(input()) list input() input ['#'] '#' s.append([['#']*(w+2)]) s.append s append [['#']*(w+2)] ['#']*(w+2) ['#'] '#' w+2 w 2 [0]*(w+2) for _ in range(h+2) for _ in range(h+2) _ range(h+2) range h+2 h 2 for _ in range(h+2) [0]*(w+2) [0] 0 w+2 w 2 l=[[0]*(w+2) for _ in range(h+2)] l [[0]*(w+2) for _ in range(h+2)] [0]*(w+2) for _ in range(h+2) for _ in range(h+2) _ range(h+2) range h+2 h 2 for _ in range(h+2) [0]*(w+2) [0] 0 w+2 w 2 r=[[0]*(w+2) for _ in range(h+2)] r [[0]*(w+2) for _ in range(h+2)] [0]*(w+2) for _ in range(h+2) for _ in range(h+2) _ range(h+2) range h+2 h 2 for _ in range(h+2) [0]*(w+2) [0] 0 w+2 w 2 u=[[0]*(w+2) for _ in range(h+2)] u [[0]*(w+2) for _ in range(h+2)] [0]*(w+2) for _ in range(h+2) for _ in range(h+2) _ range(h+2) range h+2 h 2 for _ in range(h+2) [0]*(w+2) [0] 0 w+2 w 2 d=[[0]*(w+2) for _ in range(h+2)] d [[0]*(w+2) for _ in range(h+2)] for i in range(1, h+1):
    for j in range(1, w+1):
        if s[i][j]=='.':
            l[i][j]=l[i][j-1]+1
            u[i][j]=u[i-1][j]+1
        if s[i][w+1-j]=='.':
            r[i][w+1-j]=r[i][w+2-j]+1
        if s[h+1-i][j]=='.':
            d[h+1-i][j]=d[h+2-i][j]+1 i range(1, h+1) range 1 h+1 h 1 for j in range(1, w+1):
        if s[i][j]=='.':
            l[i][j]=l[i][j-1]+1
            u[i][j]=u[i-1][j]+1
        if s[i][w+1-j]=='.':
            r[i][w+1-j]=r[i][w+2-j]+1
        if s[h+1-i][j]=='.':
            d[h+1-i][j]=d[h+2-i][j]+1 j range(1, w+1) range 1 w+1 w 1 if s[i][j]=='.':
            l[i][j]=l[i][j-1]+1
            u[i][j]=u[i-1][j]+1
         s[i][j]=='.' s[i][j] [i] s i j '.' l[i][j]=l[i][j-1]+1 l[i][j] [i] l i j l[i][j-1]+1 l[i][j-1] [i] l i j-1 j 1 1 u[i][j]=u[i-1][j]+1 u[i][j] [i] u i j u[i-1][j]+1 u[i-1][j] [i-1] u i-1 i 1 j 1 if s[i][w+1-j]=='.':
            r[i][w+1-j]=r[i][w+2-j]+1
         s[i][w+1-j]=='.' s[i][w+1-j] [i] s i w+1-j w+1 w 1 j '.' r[i][w+1-j]=r[i][w+2-j]+1 r[i][w+1-j] [i] r i w+1-j w+1 w 1 j r[i][w+2-j]+1 r[i][w+2-j] [i] r i w+2-j w+2 w 2 j 1 if s[h+1-i][j]=='.':
            d[h+1-i][j]=d[h+2-i][j]+1 s[h+1-i][j]=='.' s[h+1-i][j] [h+1-i] s h+1-i h+1 h 1 i j '.' d[h+1-i][j]=d[h+2-i][j]+1 d[h+1-i][j] [h+1-i] d h+1-i h+1 h 1 i j d[h+2-i][j]+1 d[h+2-i][j] [h+2-i] d h+2-i h+2 h 2 i j 1 ans=0 ans 0 for i in range(1, h+1):  # hはy座標
    for j in range(1, w+1):  # wはx座標
        tmp_ans=l[i][j]+r[i][j]+u[i][j]+d[i][j]-3
        ans=max(ans, tmp_ans) i range(1, h+1) range 1 h+1 h 1 for j in range(1, w+1):  # wはx座標
        tmp_ans=l[i][j]+r[i][j]+u[i][j]+d[i][j]-3
        ans=max(ans, tmp_ans) j range(1, w+1) range 1 w+1 w 1 tmp_ans=l[i][j]+r[i][j]+u[i][j]+d[i][j]-3 tmp_ans l[i][j]+r[i][j]+u[i][j]+d[i][j]-3 l[i][j]+r[i][j]+u[i][j]+d[i][j] l[i][j]+r[i][j]+u[i][j] l[i][j]+r[i][j] l[i][j] [i] l i j r[i][j] [i] r i j u[i][j] [i] u i j d[i][j] [i] d i j 3 ans=max(ans, tmp_ans) ans max(ans, tmp_ans) max ans tmp_ans print(ans) print ans h,w=map(int,input().split()) map(int,input().split()) h ans=max(ans, tmp_ans) max(ans, tmp_ans) ans ans=0 0 ans l=[[0]*(w+2) for _ in range(h+2)] [[0]*(w+2) for _ in range(h+2)] l u=[[0]*(w+2) for _ in range(h+2)] [[0]*(w+2) for _ in range(h+2)] u tmp_ans=l[i][j]+r[i][j]+u[i][j]+d[i][j]-3 l[i][j]+r[i][j]+u[i][j]+d[i][j]-3 tmp_ans s=[['#']*(w+2)] [['#']*(w+2)] s w=map(int,input().split()) map(int,input().split()) w r=[[0]*(w+2) for _ in range(h+2)] [[0]*(w+2) for _ in range(h+2)] r d=[[0]*(w+2) for _ in range(h+2)] [[0]*(w+2) for _ in range(h+2)] d
h,w=map(int,input().split())

s=[['#']*(w+2)]
for i in range(h):
    s.append(['#']+list(input())+['#'])
s.append([['#']*(w+2)])

l=[[0]*(w+2) for _ in range(h+2)]
r=[[0]*(w+2) for _ in range(h+2)]
u=[[0]*(w+2) for _ in range(h+2)]
d=[[0]*(w+2) for _ in range(h+2)]

for i in range(1, h+1):
    for j in range(1, w+1):
        if s[i][j]=='.':
            l[i][j]=l[i][j-1]+1
            u[i][j]=u[i-1][j]+1
        if s[i][w+1-j]=='.':
            r[i][w+1-j]=r[i][w+2-j]+1
        if s[h+1-i][j]=='.':
            d[h+1-i][j]=d[h+2-i][j]+1

ans=0
for i in range(1, h+1):  # hはy座標
    for j in range(1, w+1):  # wはx座標
        tmp_ans=l[i][j]+r[i][j]+u[i][j]+d[i][j]-3
        ans=max(ans, tmp_ans)
print(ans)
