import sys
input=sys.stdin.readline
H, W = [int(x) for x in input().split()]
board = []
for _ in range(H):
    board.append(input())

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 board[i][j] == '.':
            if j == 0:
                L[i][j] = 1
            else:
                L[i][j] = L[i][j - 1] + 1

for i in range(H):
    for j in reversed(range(W)):
        if board[i][j] == '.':
            if j == W - 1:
                R[i][j] = 1
            else:
                R[i][j] = R[i][j + 1] + 1

for j in range(W):
    for i in range(H):
        if board[i][j] == '.':
            if i == 0:
                U[i][j] = 1
            else:
                U[i][j] = U[i - 1][j] + 1

for j in range(W):
    for i in reversed(range(H)):
        if board[i][j] == '.':
            if i == H - 1:
                D[i][j] = 1
            else:
                D[i][j] = D[i + 1][j] + 1

ans = 0
for i in range(H):
    for j in range(W):
        cand = L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3
        ans = max(ans, cand)
        
print(ans) import sys sys input=sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x H, W = [int(x) for x in input().split()] H [int(x) for x in input().split()] W board = [] board [] for _ in range(H):
    board.append(input()) _ range(H) range H board.append(input()) board.append board append 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 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 board[i][j] == '.':
            if j == 0:
                L[i][j] = 1
            else:
                L[i][j] = L[i][j - 1] + 1 i range(H) range H for j in range(W):
        if board[i][j] == '.':
            if j == 0:
                L[i][j] = 1
            else:
                L[i][j] = L[i][j - 1] + 1 j range(W) range W if board[i][j] == '.':
            if j == 0:
                L[i][j] = 1
            else:
                L[i][j] = L[i][j - 1] + 1 board[i][j] == '.' board[i][j] [i] board i j '.' if j == 0:
                L[i][j] = 1
            else:
                L[i][j] = L[i][j - 1] + 1 j == 0 j 0 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):
    for j in reversed(range(W)):
        if board[i][j] == '.':
            if j == W - 1:
                R[i][j] = 1
            else:
                R[i][j] = R[i][j + 1] + 1 i range(H) range H for j in reversed(range(W)):
        if board[i][j] == '.':
            if j == W - 1:
                R[i][j] = 1
            else:
                R[i][j] = R[i][j + 1] + 1 j reversed(range(W)) reversed range(W) range W if board[i][j] == '.':
            if j == W - 1:
                R[i][j] = 1
            else:
                R[i][j] = R[i][j + 1] + 1 board[i][j] == '.' board[i][j] [i] board i j '.' if j == W - 1:
                R[i][j] = 1
            else:
                R[i][j] = R[i][j + 1] + 1 j == W - 1 j W - 1 W 1 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 for j in range(W):
    for i in range(H):
        if board[i][j] == '.':
            if i == 0:
                U[i][j] = 1
            else:
                U[i][j] = U[i - 1][j] + 1 j range(W) range W for i in range(H):
        if board[i][j] == '.':
            if i == 0:
                U[i][j] = 1
            else:
                U[i][j] = U[i - 1][j] + 1 i range(H) range H if board[i][j] == '.':
            if i == 0:
                U[i][j] = 1
            else:
                U[i][j] = U[i - 1][j] + 1 board[i][j] == '.' board[i][j] [i] board i j '.' if i == 0:
                U[i][j] = 1
            else:
                U[i][j] = U[i - 1][j] + 1 i == 0 i 0 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):
    for i in reversed(range(H)):
        if board[i][j] == '.':
            if i == H - 1:
                D[i][j] = 1
            else:
                D[i][j] = D[i + 1][j] + 1 j range(W) range W for i in reversed(range(H)):
        if board[i][j] == '.':
            if i == H - 1:
                D[i][j] = 1
            else:
                D[i][j] = D[i + 1][j] + 1 i reversed(range(H)) reversed range(H) range H if board[i][j] == '.':
            if i == H - 1:
                D[i][j] = 1
            else:
                D[i][j] = D[i + 1][j] + 1 board[i][j] == '.' board[i][j] [i] board i j '.' if i == H - 1:
                D[i][j] = 1
            else:
                D[i][j] = D[i + 1][j] + 1 i == H - 1 i H - 1 H 1 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 ans = 0 ans 0 for i in range(H):
    for j in range(W):
        cand = L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3
        ans = max(ans, cand)
         i range(H) range H for j in range(W):
        cand = L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3
        ans = max(ans, cand)
         j range(W) range W cand = L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3 cand 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, cand) ans max(ans, cand) max ans cand print(ans) print 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 input=sys.stdin.readline sys.stdin.readline input H, W = [int(x) for x in input().split()] [int(x) for x in input().split()] H board = [] [] board W = [int(x) for x in input().split()] [int(x) for x in input().split()] W cand = 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 cand ans = max(ans, cand) max(ans, cand) ans 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 ans = 0 0 ans
import sys
input=sys.stdin.readline
H, W = [int(x) for x in input().split()]
board = []
for _ in range(H):
    board.append(input())

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 board[i][j] == '.':
            if j == 0:
                L[i][j] = 1
            else:
                L[i][j] = L[i][j - 1] + 1

for i in range(H):
    for j in reversed(range(W)):
        if board[i][j] == '.':
            if j == W - 1:
                R[i][j] = 1
            else:
                R[i][j] = R[i][j + 1] + 1

for j in range(W):
    for i in range(H):
        if board[i][j] == '.':
            if i == 0:
                U[i][j] = 1
            else:
                U[i][j] = U[i - 1][j] + 1

for j in range(W):
    for i in reversed(range(H)):
        if board[i][j] == '.':
            if i == H - 1:
                D[i][j] = 1
            else:
                D[i][j] = D[i + 1][j] + 1

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