H,W = map(int,input().split())
S = [input() for i in range(H)]

U = [[0]*W for i in range(H)]
D = [[0]*W for i in range(H)]
R = [[0]*W for i in range(H)]
L = [[0]*W for i in range(H)]

for i in range(H):
    for j in range(W):
        if S[i][j] == '#':
            U[i][j] = 0
        elif i == 0 and S[i][j] == '.':
            U[i][j] = 1
        else:
            U[i][j] = U[i-1][j] + 1
            
    for j in range(W):
        if S[i][j] == '#':
            L[i][j] = 0
        elif j == 0 and S[i][j] == '.':
            L[i][j] = 1
        else:
            L[i][j] = L[i][j-1] + 1
            
for i in range(H-1,-1,-1):
    for j in range(W-1,-1,-1):
        if S[i][j] == '#':
            D[i][j] = 0
        elif i == H-1 and S[i][j] == '.':
            D[i][j] = 1
        else:
            D[i][j] = D[i+1][j] + 1
            
    for j in range(W-1,-1,-1):
        if S[i][j] == '#':
            R[i][j] = 0
        elif j == W-1 and S[i][j] == '.':
            R[i][j] = 1
        else:
            R[i][j] = R[i][j+1] + 1
            
ans = 0 

for i in range(H):
    for j in range(W):
        ans = max(ans,U[i][j]+R[i][j]+D[i][j]+L[i][j]-3)        
print(ans)     H,W = map(int,input().split()) H map(int,input().split()) map int input().split() ().split () input split W input() for i in range(H) for i in range(H) i range(H) range H for i in range(H) input() input S = [input() for i in range(H)] S [input() for i in range(H)] [0]*W for i in range(H) for i in range(H) i range(H) range H for i in range(H) [0]*W [0] 0 W U = [[0]*W for i in range(H)] U [[0]*W for i in range(H)] [0]*W for i in range(H) for i in range(H) i range(H) range H for i in range(H) [0]*W [0] 0 W D = [[0]*W for i in range(H)] D [[0]*W for i in range(H)] [0]*W for i in range(H) for i in range(H) i range(H) range H for i in range(H) [0]*W [0] 0 W R = [[0]*W for i in range(H)] R [[0]*W for i in range(H)] [0]*W for i in range(H) for i in range(H) i range(H) range H for i in range(H) [0]*W [0] 0 W L = [[0]*W for i in range(H)] L [[0]*W for i in range(H)] for i in range(H):
    for j in range(W):
        if S[i][j] == '#':
            U[i][j] = 0
        elif i == 0 and S[i][j] == '.':
            U[i][j] = 1
        else:
            U[i][j] = U[i-1][j] + 1
            
    for j in range(W):
        if S[i][j] == '#':
            L[i][j] = 0
        elif j == 0 and S[i][j] == '.':
            L[i][j] = 1
        else:
            L[i][j] = L[i][j-1] + 1
             i range(H) range H for j in range(W):
        if S[i][j] == '#':
            U[i][j] = 0
        elif i == 0 and S[i][j] == '.':
            U[i][j] = 1
        else:
            U[i][j] = U[i-1][j] + 1
            
     j range(W) range W if S[i][j] == '#':
            U[i][j] = 0
        elif i == 0 and S[i][j] == '.':
            U[i][j] = 1
        else:
            U[i][j] = U[i-1][j] + 1
            
     S[i][j] == '#' S[i][j] [i] S i j '#' U[i][j] = 0 U[i][j] [i] U i j 0 elif i == 0 and S[i][j] == '.':
            U[i][j] = 1
         i == 0 and S[i][j] == '.' i == 0 i 0 S[i][j] == '.' S[i][j] [i] S i j '.' U[i][j] = 1 U[i][j] [i] U i j 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 for j in range(W):
        if S[i][j] == '#':
            L[i][j] = 0
        elif j == 0 and S[i][j] == '.':
            L[i][j] = 1
        else:
            L[i][j] = L[i][j-1] + 1
             j range(W) range W if S[i][j] == '#':
            L[i][j] = 0
        elif j == 0 and S[i][j] == '.':
            L[i][j] = 1
        else:
            L[i][j] = L[i][j-1] + 1
             S[i][j] == '#' S[i][j] [i] S i j '#' L[i][j] = 0 L[i][j] [i] L i j 0 elif j == 0 and S[i][j] == '.':
            L[i][j] = 1
         j == 0 and S[i][j] == '.' j == 0 j 0 S[i][j] == '.' S[i][j] [i] S i j '.' L[i][j] = 1 L[i][j] [i] L i j 1 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 for i in range(H-1,-1,-1):
    for j in range(W-1,-1,-1):
        if S[i][j] == '#':
            D[i][j] = 0
        elif i == H-1 and S[i][j] == '.':
            D[i][j] = 1
        else:
            D[i][j] = D[i+1][j] + 1
            
    for j in range(W-1,-1,-1):
        if S[i][j] == '#':
            R[i][j] = 0
        elif j == W-1 and S[i][j] == '.':
            R[i][j] = 1
        else:
            R[i][j] = R[i][j+1] + 1
             i range(H-1,-1,-1) range H-1 H 1 -1 -1 for j in range(W-1,-1,-1):
        if S[i][j] == '#':
            D[i][j] = 0
        elif i == H-1 and S[i][j] == '.':
            D[i][j] = 1
        else:
            D[i][j] = D[i+1][j] + 1
            
     j range(W-1,-1,-1) range W-1 W 1 -1 -1 if S[i][j] == '#':
            D[i][j] = 0
        elif i == H-1 and S[i][j] == '.':
            D[i][j] = 1
        else:
            D[i][j] = D[i+1][j] + 1
            
     S[i][j] == '#' S[i][j] [i] S i j '#' D[i][j] = 0 D[i][j] [i] D i j 0 elif i == H-1 and S[i][j] == '.':
            D[i][j] = 1
         i == H-1 and S[i][j] == '.' i == H-1 i H-1 H 1 S[i][j] == '.' S[i][j] [i] S i j '.' D[i][j] = 1 D[i][j] [i] D i j 1 D[i][j] = D[i+1][j] + 1 D[i][j] [i] D i j D[i+1][j] + 1 D[i+1][j] [i+1] D i+1 i 1 j 1 for j in range(W-1,-1,-1):
        if S[i][j] == '#':
            R[i][j] = 0
        elif j == W-1 and S[i][j] == '.':
            R[i][j] = 1
        else:
            R[i][j] = R[i][j+1] + 1
             j range(W-1,-1,-1) range W-1 W 1 -1 -1 if S[i][j] == '#':
            R[i][j] = 0
        elif j == W-1 and S[i][j] == '.':
            R[i][j] = 1
        else:
            R[i][j] = R[i][j+1] + 1
             S[i][j] == '#' S[i][j] [i] S i j '#' R[i][j] = 0 R[i][j] [i] R i j 0 elif j == W-1 and S[i][j] == '.':
            R[i][j] = 1
         j == W-1 and S[i][j] == '.' j == W-1 j W-1 W 1 S[i][j] == '.' S[i][j] [i] S i j '.' R[i][j] = 1 R[i][j] [i] R i j 1 R[i][j] = R[i][j+1] + 1 R[i][j] [i] R i j R[i][j+1] + 1 R[i][j+1] [i] R i j+1 j 1 1 ans = 0 ans 0 for i in range(H):
    for j in range(W):
        ans = max(ans,U[i][j]+R[i][j]+D[i][j]+L[i][j]-3)         i range(H) range H for j in range(W):
        ans = max(ans,U[i][j]+R[i][j]+D[i][j]+L[i][j]-3)         j range(W) range W ans = max(ans,U[i][j]+R[i][j]+D[i][j]+L[i][j]-3) ans max(ans,U[i][j]+R[i][j]+D[i][j]+L[i][j]-3) max ans U[i][j]+R[i][j]+D[i][j]+L[i][j]-3 U[i][j]+R[i][j]+D[i][j]+L[i][j] U[i][j]+R[i][j]+D[i][j] U[i][j]+R[i][j] U[i][j] [i] U i j R[i][j] [i] R i j D[i][j] [i] D i j L[i][j] [i] L i j 3 print(ans) print ans U = [[0]*W for i in range(H)] [[0]*W for i in range(H)] U R = [[0]*W for i in range(H)] [[0]*W for i in range(H)] R W = map(int,input().split()) map(int,input().split()) W L = [[0]*W for i in range(H)] [[0]*W for i in range(H)] L H,W = map(int,input().split()) map(int,input().split()) H D = [[0]*W for i in range(H)] [[0]*W for i in range(H)] D S = [input() for i in range(H)] [input() for i in range(H)] S ans = max(ans,U[i][j]+R[i][j]+D[i][j]+L[i][j]-3) max(ans,U[i][j]+R[i][j]+D[i][j]+L[i][j]-3) ans ans = 0 0 ans
H,W = map(int,input().split())
S = [input() for i in range(H)]

U = [[0]*W for i in range(H)]
D = [[0]*W for i in range(H)]
R = [[0]*W for i in range(H)]
L = [[0]*W for i in range(H)]

for i in range(H):
    for j in range(W):
        if S[i][j] == '#':
            U[i][j] = 0
        elif i == 0 and S[i][j] == '.':
            U[i][j] = 1
        else:
            U[i][j] = U[i-1][j] + 1
            
    for j in range(W):
        if S[i][j] == '#':
            L[i][j] = 0
        elif j == 0 and S[i][j] == '.':
            L[i][j] = 1
        else:
            L[i][j] = L[i][j-1] + 1
            
for i in range(H-1,-1,-1):
    for j in range(W-1,-1,-1):
        if S[i][j] == '#':
            D[i][j] = 0
        elif i == H-1 and S[i][j] == '.':
            D[i][j] = 1
        else:
            D[i][j] = D[i+1][j] + 1
            
    for j in range(W-1,-1,-1):
        if S[i][j] == '#':
            R[i][j] = 0
        elif j == W-1 and S[i][j] == '.':
            R[i][j] = 1
        else:
            R[i][j] = R[i][j+1] + 1
            
ans = 0 

for i in range(H):
    for j in range(W):
        ans = max(ans,U[i][j]+R[i][j]+D[i][j]+L[i][j]-3)        
print(ans)    