H, W = map(int, input().split())

graph = []
for i in range(H):
    graph.append(input())

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


for y in range(H):
    for x in range(W):
        if graph[y][x] == "#":
            L[y][x] = 0
        elif x == 0:
            L[y][x] = 1
        else:
            L[y][x] = L[y][x-1] + 1

for x in range(W):
    for y in range(H):
        if graph[y][x] == "#":
            U[y][x] = 0
        elif y == 0:
            U[y][x] = 1
        else:
            U[y][x] = U[y-1][x] + 1

for x in range(W):
    for y in range(H-1, -1, -1):
        if graph[y][x] == "#":
            D[y][x] = 0
        elif y == H-1:
            D[y][x] = 1
        else:
            D[y][x] = D[y+1][x] + 1

for y in range(H):
    for x in range(W-1, -1, -1):
        if graph[y][x] == "#":
            R[y][x] = 0
        elif x == W-1:
            R[y][x] = 1
        else:
            R[y][x] = R[y][x+1] + 1

ans = -1
for y in range(H):
    for x in range(W):
        ans = max(ans, L[y][x] + R[y][x] + U[y][x] + D[y][x] - 3)

print(ans) H, W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W graph = [] graph [] for i in range(H):
    graph.append(input()) i range(H) range H graph.append(input()) graph.append graph append input() input [0 for _ in range(W)] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0 for _ in range(W)] L = [[0 for _ in range(W)] for _ in range(H)] L [[0 for _ in range(W)] for _ in range(H)] [0 for _ in range(W)] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0 for _ in range(W)] U = [[0 for _ in range(W)] for _ in range(H)] U [[0 for _ in range(W)] for _ in range(H)] [0 for _ in range(W)] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0 for _ in range(W)] D = [[0 for _ in range(W)] for _ in range(H)] D [[0 for _ in range(W)] for _ in range(H)] [0 for _ in range(W)] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0 for _ in range(W)] R = [[0 for _ in range(W)] for _ in range(H)] R [[0 for _ in range(W)] for _ in range(H)] for y in range(H):
    for x in range(W):
        if graph[y][x] == "#":
            L[y][x] = 0
        elif x == 0:
            L[y][x] = 1
        else:
            L[y][x] = L[y][x-1] + 1 y range(H) range H for x in range(W):
        if graph[y][x] == "#":
            L[y][x] = 0
        elif x == 0:
            L[y][x] = 1
        else:
            L[y][x] = L[y][x-1] + 1 x range(W) range W if graph[y][x] == "#":
            L[y][x] = 0
        elif x == 0:
            L[y][x] = 1
        else:
            L[y][x] = L[y][x-1] + 1 graph[y][x] == "#" graph[y][x] [y] graph y x "#" L[y][x] = 0 L[y][x] [y] L y x 0 elif x == 0:
            L[y][x] = 1
         x == 0 x 0 L[y][x] = 1 L[y][x] [y] L y x 1 L[y][x] = L[y][x-1] + 1 L[y][x] [y] L y x L[y][x-1] + 1 L[y][x-1] [y] L y x-1 x 1 1 for x in range(W):
    for y in range(H):
        if graph[y][x] == "#":
            U[y][x] = 0
        elif y == 0:
            U[y][x] = 1
        else:
            U[y][x] = U[y-1][x] + 1 x range(W) range W for y in range(H):
        if graph[y][x] == "#":
            U[y][x] = 0
        elif y == 0:
            U[y][x] = 1
        else:
            U[y][x] = U[y-1][x] + 1 y range(H) range H if graph[y][x] == "#":
            U[y][x] = 0
        elif y == 0:
            U[y][x] = 1
        else:
            U[y][x] = U[y-1][x] + 1 graph[y][x] == "#" graph[y][x] [y] graph y x "#" U[y][x] = 0 U[y][x] [y] U y x 0 elif y == 0:
            U[y][x] = 1
         y == 0 y 0 U[y][x] = 1 U[y][x] [y] U y x 1 U[y][x] = U[y-1][x] + 1 U[y][x] [y] U y x U[y-1][x] + 1 U[y-1][x] [y-1] U y-1 y 1 x 1 for x in range(W):
    for y in range(H-1, -1, -1):
        if graph[y][x] == "#":
            D[y][x] = 0
        elif y == H-1:
            D[y][x] = 1
        else:
            D[y][x] = D[y+1][x] + 1 x range(W) range W for y in range(H-1, -1, -1):
        if graph[y][x] == "#":
            D[y][x] = 0
        elif y == H-1:
            D[y][x] = 1
        else:
            D[y][x] = D[y+1][x] + 1 y range(H-1, -1, -1) range H-1 H 1 -1 -1 if graph[y][x] == "#":
            D[y][x] = 0
        elif y == H-1:
            D[y][x] = 1
        else:
            D[y][x] = D[y+1][x] + 1 graph[y][x] == "#" graph[y][x] [y] graph y x "#" D[y][x] = 0 D[y][x] [y] D y x 0 elif y == H-1:
            D[y][x] = 1
         y == H-1 y H-1 H 1 D[y][x] = 1 D[y][x] [y] D y x 1 D[y][x] = D[y+1][x] + 1 D[y][x] [y] D y x D[y+1][x] + 1 D[y+1][x] [y+1] D y+1 y 1 x 1 for y in range(H):
    for x in range(W-1, -1, -1):
        if graph[y][x] == "#":
            R[y][x] = 0
        elif x == W-1:
            R[y][x] = 1
        else:
            R[y][x] = R[y][x+1] + 1 y range(H) range H for x in range(W-1, -1, -1):
        if graph[y][x] == "#":
            R[y][x] = 0
        elif x == W-1:
            R[y][x] = 1
        else:
            R[y][x] = R[y][x+1] + 1 x range(W-1, -1, -1) range W-1 W 1 -1 -1 if graph[y][x] == "#":
            R[y][x] = 0
        elif x == W-1:
            R[y][x] = 1
        else:
            R[y][x] = R[y][x+1] + 1 graph[y][x] == "#" graph[y][x] [y] graph y x "#" R[y][x] = 0 R[y][x] [y] R y x 0 elif x == W-1:
            R[y][x] = 1
         x == W-1 x W-1 W 1 R[y][x] = 1 R[y][x] [y] R y x 1 R[y][x] = R[y][x+1] + 1 R[y][x] [y] R y x R[y][x+1] + 1 R[y][x+1] [y] R y x+1 x 1 1 ans = -1 ans -1 for y in range(H):
    for x in range(W):
        ans = max(ans, L[y][x] + R[y][x] + U[y][x] + D[y][x] - 3) y range(H) range H for x in range(W):
        ans = max(ans, L[y][x] + R[y][x] + U[y][x] + D[y][x] - 3) x range(W) range W ans = max(ans, L[y][x] + R[y][x] + U[y][x] + D[y][x] - 3) ans max(ans, L[y][x] + R[y][x] + U[y][x] + D[y][x] - 3) max ans L[y][x] + R[y][x] + U[y][x] + D[y][x] - 3 L[y][x] + R[y][x] + U[y][x] + D[y][x] L[y][x] + R[y][x] + U[y][x] L[y][x] + R[y][x] L[y][x] [y] L y x R[y][x] [y] R y x U[y][x] [y] U y x D[y][x] [y] D y x 3 print(ans) print ans R = [[0 for _ in range(W)] for _ in range(H)] [[0 for _ in range(W)] for _ in range(H)] R ans = -1 -1 ans W = map(int, input().split()) map(int, input().split()) W L = [[0 for _ in range(W)] for _ in range(H)] [[0 for _ in range(W)] for _ in range(H)] L D = [[0 for _ in range(W)] for _ in range(H)] [[0 for _ in range(W)] for _ in range(H)] D H, W = map(int, input().split()) map(int, input().split()) H U = [[0 for _ in range(W)] for _ in range(H)] [[0 for _ in range(W)] for _ in range(H)] U graph = [] [] graph ans = max(ans, L[y][x] + R[y][x] + U[y][x] + D[y][x] - 3) max(ans, L[y][x] + R[y][x] + U[y][x] + D[y][x] - 3) ans
H, W = map(int, input().split())

graph = []
for i in range(H):
    graph.append(input())

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


for y in range(H):
    for x in range(W):
        if graph[y][x] == "#":
            L[y][x] = 0
        elif x == 0:
            L[y][x] = 1
        else:
            L[y][x] = L[y][x-1] + 1

for x in range(W):
    for y in range(H):
        if graph[y][x] == "#":
            U[y][x] = 0
        elif y == 0:
            U[y][x] = 1
        else:
            U[y][x] = U[y-1][x] + 1

for x in range(W):
    for y in range(H-1, -1, -1):
        if graph[y][x] == "#":
            D[y][x] = 0
        elif y == H-1:
            D[y][x] = 1
        else:
            D[y][x] = D[y+1][x] + 1

for y in range(H):
    for x in range(W-1, -1, -1):
        if graph[y][x] == "#":
            R[y][x] = 0
        elif x == W-1:
            R[y][x] = 1
        else:
            R[y][x] = R[y][x+1] + 1

ans = -1
for y in range(H):
    for x in range(W):
        ans = max(ans, L[y][x] + R[y][x] + U[y][x] + D[y][x] - 3)

print(ans)
