import sys,math,collections,itertools
input = sys.stdin.readline

H,W = list(map(int,input().split()))
s = [input().rstrip() for _ in range(H)]
maperW = [[0]*W for _ in range(H)]
maperH = [[0]*W for _ in range(H)]


#--W方向を調べる--#
for ih in range(H):
    for iw in range(W):
        if s[ih][iw]=='#':
            maperW[ih][iw]=0
        elif s[ih][iw]=='.' and iw == 0:
            maperW[ih][iw]=1
        else:
            maperW[ih][iw]=1+maperW[ih][iw-1]
    for iw in range(W-2,-1,-1):
        if maperW[ih][iw+1] == 0 or maperW[ih][iw]==0:
            continue
        else:
            maperW[ih][iw] = maperW[ih][iw+1]
#--H方向を調べる--#
for iw in range(W):
    for ih in range(H):
        if s[ih][iw]=='#':
            maperH[ih][iw]=0
        elif s[ih][iw]=='.' and ih == 0:
            maperH[ih][iw]=1
        else:
            maperH[ih][iw]=1+maperH[ih-1][iw]
    for ih in range(H-2,-1,-1):
        if maperH[ih+1][iw] == 0 or maperH[ih][iw]==0:
            continue
        else:
            maperH[ih][iw] = maperH[ih+1][iw]
ans = 0
for iw in range(W):
    for ih in range(H):
        ans = max(ans,maperW[ih][iw]+maperH[ih][iw]-1)
print(ans) import sys,math,collections,itertools sys math collections itertools input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline H,W = list(map(int,input().split())) H list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split W input().rstrip() for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) input().rstrip() ().rstrip () input rstrip s = [input().rstrip() for _ in range(H)] s [input().rstrip() 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 maperW = [[0]*W for _ in range(H)] maperW [[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 maperH = [[0]*W for _ in range(H)] maperH [[0]*W for _ in range(H)] for ih in range(H):
    for iw in range(W):
        if s[ih][iw]=='#':
            maperW[ih][iw]=0
        elif s[ih][iw]=='.' and iw == 0:
            maperW[ih][iw]=1
        else:
            maperW[ih][iw]=1+maperW[ih][iw-1]
    for iw in range(W-2,-1,-1):
        if maperW[ih][iw+1] == 0 or maperW[ih][iw]==0:
            continue
        else:
            maperW[ih][iw] = maperW[ih][iw+1]
#--H方向を調べる--# ih range(H) range H for iw in range(W):
        if s[ih][iw]=='#':
            maperW[ih][iw]=0
        elif s[ih][iw]=='.' and iw == 0:
            maperW[ih][iw]=1
        else:
            maperW[ih][iw]=1+maperW[ih][iw-1]
     iw range(W) range W if s[ih][iw]=='#':
            maperW[ih][iw]=0
        elif s[ih][iw]=='.' and iw == 0:
            maperW[ih][iw]=1
        else:
            maperW[ih][iw]=1+maperW[ih][iw-1]
     s[ih][iw]=='#' s[ih][iw] [ih] s ih iw '#' maperW[ih][iw]=0 maperW[ih][iw] [ih] maperW ih iw 0 elif s[ih][iw]=='.' and iw == 0:
            maperW[ih][iw]=1
         s[ih][iw]=='.' and iw == 0 s[ih][iw]=='.' s[ih][iw] [ih] s ih iw '.' iw == 0 iw 0 maperW[ih][iw]=1 maperW[ih][iw] [ih] maperW ih iw 1 maperW[ih][iw]=1+maperW[ih][iw-1] maperW[ih][iw] [ih] maperW ih iw 1+maperW[ih][iw-1] 1 maperW[ih][iw-1] [ih] maperW ih iw-1 iw 1 for iw in range(W-2,-1,-1):
        if maperW[ih][iw+1] == 0 or maperW[ih][iw]==0:
            continue
        else:
            maperW[ih][iw] = maperW[ih][iw+1]
#--H方向を調べる--# iw range(W-2,-1,-1) range W-2 W 2 -1 -1 if maperW[ih][iw+1] == 0 or maperW[ih][iw]==0:
            continue
        else:
            maperW[ih][iw] = maperW[ih][iw+1]
#--H方向を調べる--# maperW[ih][iw+1] == 0 or maperW[ih][iw]==0 maperW[ih][iw+1] == 0 maperW[ih][iw+1] [ih] maperW ih iw+1 iw 1 0 maperW[ih][iw]==0 maperW[ih][iw] [ih] maperW ih iw 0 continue maperW[ih][iw] = maperW[ih][iw+1] maperW[ih][iw] [ih] maperW ih iw maperW[ih][iw+1] [ih] maperW ih iw+1 iw 1 for iw in range(W):
    for ih in range(H):
        if s[ih][iw]=='#':
            maperH[ih][iw]=0
        elif s[ih][iw]=='.' and ih == 0:
            maperH[ih][iw]=1
        else:
            maperH[ih][iw]=1+maperH[ih-1][iw]
    for ih in range(H-2,-1,-1):
        if maperH[ih+1][iw] == 0 or maperH[ih][iw]==0:
            continue
        else:
            maperH[ih][iw] = maperH[ih+1][iw] iw range(W) range W for ih in range(H):
        if s[ih][iw]=='#':
            maperH[ih][iw]=0
        elif s[ih][iw]=='.' and ih == 0:
            maperH[ih][iw]=1
        else:
            maperH[ih][iw]=1+maperH[ih-1][iw]
     ih range(H) range H if s[ih][iw]=='#':
            maperH[ih][iw]=0
        elif s[ih][iw]=='.' and ih == 0:
            maperH[ih][iw]=1
        else:
            maperH[ih][iw]=1+maperH[ih-1][iw]
     s[ih][iw]=='#' s[ih][iw] [ih] s ih iw '#' maperH[ih][iw]=0 maperH[ih][iw] [ih] maperH ih iw 0 elif s[ih][iw]=='.' and ih == 0:
            maperH[ih][iw]=1
         s[ih][iw]=='.' and ih == 0 s[ih][iw]=='.' s[ih][iw] [ih] s ih iw '.' ih == 0 ih 0 maperH[ih][iw]=1 maperH[ih][iw] [ih] maperH ih iw 1 maperH[ih][iw]=1+maperH[ih-1][iw] maperH[ih][iw] [ih] maperH ih iw 1+maperH[ih-1][iw] 1 maperH[ih-1][iw] [ih-1] maperH ih-1 ih 1 iw for ih in range(H-2,-1,-1):
        if maperH[ih+1][iw] == 0 or maperH[ih][iw]==0:
            continue
        else:
            maperH[ih][iw] = maperH[ih+1][iw] ih range(H-2,-1,-1) range H-2 H 2 -1 -1 if maperH[ih+1][iw] == 0 or maperH[ih][iw]==0:
            continue
        else:
            maperH[ih][iw] = maperH[ih+1][iw] maperH[ih+1][iw] == 0 or maperH[ih][iw]==0 maperH[ih+1][iw] == 0 maperH[ih+1][iw] [ih+1] maperH ih+1 ih 1 iw 0 maperH[ih][iw]==0 maperH[ih][iw] [ih] maperH ih iw 0 continue maperH[ih][iw] = maperH[ih+1][iw] maperH[ih][iw] [ih] maperH ih iw maperH[ih+1][iw] [ih+1] maperH ih+1 ih 1 iw ans = 0 ans 0 for iw in range(W):
    for ih in range(H):
        ans = max(ans,maperW[ih][iw]+maperH[ih][iw]-1) iw range(W) range W for ih in range(H):
        ans = max(ans,maperW[ih][iw]+maperH[ih][iw]-1) ih range(H) range H ans = max(ans,maperW[ih][iw]+maperH[ih][iw]-1) ans max(ans,maperW[ih][iw]+maperH[ih][iw]-1) max ans maperW[ih][iw]+maperH[ih][iw]-1 maperW[ih][iw]+maperH[ih][iw] maperW[ih][iw] [ih] maperW ih iw maperH[ih][iw] [ih] maperH ih iw 1 print(ans) print ans input = sys.stdin.readline sys.stdin.readline input maperH = [[0]*W for _ in range(H)] [[0]*W for _ in range(H)] maperH W = list(map(int,input().split())) list(map(int,input().split())) W ans = max(ans,maperW[ih][iw]+maperH[ih][iw]-1) max(ans,maperW[ih][iw]+maperH[ih][iw]-1) ans s = [input().rstrip() for _ in range(H)] [input().rstrip() for _ in range(H)] s H,W = list(map(int,input().split())) list(map(int,input().split())) H maperW = [[0]*W for _ in range(H)] [[0]*W for _ in range(H)] maperW ans = 0 0 ans
import sys,math,collections,itertools
input = sys.stdin.readline

H,W = list(map(int,input().split()))
s = [input().rstrip() for _ in range(H)]
maperW = [[0]*W for _ in range(H)]
maperH = [[0]*W for _ in range(H)]


#--W方向を調べる--#
for ih in range(H):
    for iw in range(W):
        if s[ih][iw]=='#':
            maperW[ih][iw]=0
        elif s[ih][iw]=='.' and iw == 0:
            maperW[ih][iw]=1
        else:
            maperW[ih][iw]=1+maperW[ih][iw-1]
    for iw in range(W-2,-1,-1):
        if maperW[ih][iw+1] == 0 or maperW[ih][iw]==0:
            continue
        else:
            maperW[ih][iw] = maperW[ih][iw+1]
#--H方向を調べる--#
for iw in range(W):
    for ih in range(H):
        if s[ih][iw]=='#':
            maperH[ih][iw]=0
        elif s[ih][iw]=='.' and ih == 0:
            maperH[ih][iw]=1
        else:
            maperH[ih][iw]=1+maperH[ih-1][iw]
    for ih in range(H-2,-1,-1):
        if maperH[ih+1][iw] == 0 or maperH[ih][iw]==0:
            continue
        else:
            maperH[ih][iw] = maperH[ih+1][iw]
ans = 0
for iw in range(W):
    for ih in range(H):
        ans = max(ans,maperW[ih][iw]+maperH[ih][iw]-1)
print(ans)
