h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]

U = [[0 for _ in range(w)] for _ in range(h)]
D = [[0 for _ in range(w)] for _ in range(h)]
L = [[0 for _ in range(w)] for _ in range(h)]
R = [[0 for _ in range(w)] for _ in range(h)]

for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            U[i][j] = 0
            L[i][j] = 0
        else:
            if i == 0:
                U[i][j] = 1
            else:
                U[i][j] = U[i - 1][j] + 1
            if j == 0:
                L[i][j] = 1
            else:
                L[i][j] = L[i][j - 1] + 1


for i in reversed(range(h)):
    for j in reversed(range(w)):
        if s[i][j] == "#":
            D[i][j] = 0
            R[i][j] = 0
        else:
            if i == h-1:
                D[i][j] = 1
            else:
                D[i][j] = D[i + 1][j] + 1
            if j == w-1:
                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] + D[i][j] + L[i][j] + R[i][j] - 3)

print(ans) h, w = map(int, input().split()) h map(int, input().split()) map int input().split() ().split () input split w list(input()) for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) list(input()) list input() input s = [list(input()) for _ in range(h)] s [list(input()) 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)] 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)] R = [[0 for _ in range(w)] for _ in range(h)] R [[0 for _ in range(w)] for _ in range(h)] for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            U[i][j] = 0
            L[i][j] = 0
        else:
            if i == 0:
                U[i][j] = 1
            else:
                U[i][j] = U[i - 1][j] + 1
            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 s[i][j] == "#":
            U[i][j] = 0
            L[i][j] = 0
        else:
            if i == 0:
                U[i][j] = 1
            else:
                U[i][j] = U[i - 1][j] + 1
            if j == 0:
                L[i][j] = 1
            else:
                L[i][j] = L[i][j - 1] + 1 j range(w) range w if s[i][j] == "#":
            U[i][j] = 0
            L[i][j] = 0
        else:
            if i == 0:
                U[i][j] = 1
            else:
                U[i][j] = U[i - 1][j] + 1
            if j == 0:
                L[i][j] = 1
            else:
                L[i][j] = L[i][j - 1] + 1 s[i][j] == "#" s[i][j] [i] s i j "#" U[i][j] = 0 U[i][j] [i] U i j 0 L[i][j] = 0 L[i][j] [i] L i j 0 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 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 reversed(range(h)):
    for j in reversed(range(w)):
        if s[i][j] == "#":
            D[i][j] = 0
            R[i][j] = 0
        else:
            if i == h-1:
                D[i][j] = 1
            else:
                D[i][j] = D[i + 1][j] + 1
            if j == w-1:
                R[i][j] = 1
            else:
                R[i][j] = R[i][j + 1] + 1 i reversed(range(h)) reversed range(h) range h for j in reversed(range(w)):
        if s[i][j] == "#":
            D[i][j] = 0
            R[i][j] = 0
        else:
            if i == h-1:
                D[i][j] = 1
            else:
                D[i][j] = D[i + 1][j] + 1
            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 s[i][j] == "#":
            D[i][j] = 0
            R[i][j] = 0
        else:
            if i == h-1:
                D[i][j] = 1
            else:
                D[i][j] = D[i + 1][j] + 1
            if j == w-1:
                R[i][j] = 1
            else:
                R[i][j] = R[i][j + 1] + 1 s[i][j] == "#" s[i][j] [i] s i j "#" D[i][j] = 0 D[i][j] [i] D i j 0 R[i][j] = 0 R[i][j] [i] R i j 0 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 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 ans = 0 ans 0 for i in range(h):
    for j in range(w):
        ans = max(ans, U[i][j] + D[i][j] + L[i][j] + R[i][j] - 3) i range(h) range h for j in range(w):
        ans = max(ans, U[i][j] + D[i][j] + L[i][j] + R[i][j] - 3) j range(w) range w ans = max(ans, U[i][j] + D[i][j] + L[i][j] + R[i][j] - 3) ans max(ans, U[i][j] + D[i][j] + L[i][j] + R[i][j] - 3) max ans U[i][j] + D[i][j] + L[i][j] + R[i][j] - 3 U[i][j] + D[i][j] + L[i][j] + R[i][j] U[i][j] + D[i][j] + L[i][j] U[i][j] + D[i][j] U[i][j] [i] U i j D[i][j] [i] D i j L[i][j] [i] L i j R[i][j] [i] R i j 3 print(ans) print ans U = [[0 for _ in range(w)] for _ in range(h)] [[0 for _ in range(w)] for _ in range(h)] U ans = 0 0 ans h, w = map(int, input().split()) map(int, input().split()) h s = [list(input()) for _ in range(h)] [list(input()) for _ in range(h)] s ans = max(ans, U[i][j] + D[i][j] + L[i][j] + R[i][j] - 3) max(ans, U[i][j] + D[i][j] + L[i][j] + R[i][j] - 3) ans w = map(int, input().split()) map(int, input().split()) w R = [[0 for _ in range(w)] for _ in range(h)] [[0 for _ in range(w)] for _ in range(h)] R D = [[0 for _ in range(w)] for _ in range(h)] [[0 for _ in range(w)] for _ in range(h)] D L = [[0 for _ in range(w)] for _ in range(h)] [[0 for _ in range(w)] for _ in range(h)] L
h, w = map(int, input().split())
s = [list(input()) for _ in range(h)]

U = [[0 for _ in range(w)] for _ in range(h)]
D = [[0 for _ in range(w)] for _ in range(h)]
L = [[0 for _ in range(w)] for _ in range(h)]
R = [[0 for _ in range(w)] for _ in range(h)]

for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            U[i][j] = 0
            L[i][j] = 0
        else:
            if i == 0:
                U[i][j] = 1
            else:
                U[i][j] = U[i - 1][j] + 1
            if j == 0:
                L[i][j] = 1
            else:
                L[i][j] = L[i][j - 1] + 1


for i in reversed(range(h)):
    for j in reversed(range(w)):
        if s[i][j] == "#":
            D[i][j] = 0
            R[i][j] = 0
        else:
            if i == h-1:
                D[i][j] = 1
            else:
                D[i][j] = D[i + 1][j] + 1
            if j == w-1:
                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] + D[i][j] + L[i][j] + R[i][j] - 3)

print(ans)