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

yoko = [[0] * W for i in range(H)]

for i in range(H):
    for j in range(W):
        if yoko[i][j] != 0:
            continue
        elif S[i][j] == "#":
            yoko[i][j] = 0
        else:
            k = 0
            while S[i][j+k] == ".":
                k += 1
                if j+k == W:
                    break
            yoko[i][j:j+k] = [k] * k

tate = [[0] * W for i in range(H)]

for j in range(W):
    for i in range(H):
        if tate[i][j] != 0:
            continue
        elif S[i][j] == "#":
            tate[i][j] = 0
        else:
            k = 0
            while S[i+k][j] == ".":
                k += 1
                if i+k == H:
                    break
            for l in range(k):
                tate[i+l][j] = k

#for i in range(H):
#    print(tate[i])

ans = 0
for i in range(H):
    for j in range(W):
        ans = max(ans, yoko[i][j] + tate[i][j] - 1)

print(ans) H, W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W S = [0] * H S [0] * H [0] 0 H for i in range(H):
    S[i] = input() i range(H) range H S[i] = input() S[i] S i input() input [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 yoko = [[0] * W for i in range(H)] yoko [[0] * W for i in range(H)] for i in range(H):
    for j in range(W):
        if yoko[i][j] != 0:
            continue
        elif S[i][j] == "#":
            yoko[i][j] = 0
        else:
            k = 0
            while S[i][j+k] == ".":
                k += 1
                if j+k == W:
                    break
            yoko[i][j:j+k] = [k] * k i range(H) range H for j in range(W):
        if yoko[i][j] != 0:
            continue
        elif S[i][j] == "#":
            yoko[i][j] = 0
        else:
            k = 0
            while S[i][j+k] == ".":
                k += 1
                if j+k == W:
                    break
            yoko[i][j:j+k] = [k] * k j range(W) range W if yoko[i][j] != 0:
            continue
        elif S[i][j] == "#":
            yoko[i][j] = 0
        else:
            k = 0
            while S[i][j+k] == ".":
                k += 1
                if j+k == W:
                    break
            yoko[i][j:j+k] = [k] * k yoko[i][j] != 0 yoko[i][j] [i] yoko i j 0 continue elif S[i][j] == "#":
            yoko[i][j] = 0
         S[i][j] == "#" S[i][j] [i] S i j "#" yoko[i][j] = 0 yoko[i][j] [i] yoko i j 0 k = 0 k 0 while S[i][j+k] == ".":
                k += 1
                if j+k == W:
                    break
             S[i][j+k] == "." S[i][j+k] [i] S i j+k j k "." k += 1 k 1 if j+k == W:
                    break
             j+k == W j+k j k W break yoko[i][j:j+k] = [k] * k yoko[i][j:j+k] [i] yoko i j:j+k j j+k j k [k] * k [k] k k [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 tate = [[0] * W for i in range(H)] tate [[0] * W for i in range(H)] for j in range(W):
    for i in range(H):
        if tate[i][j] != 0:
            continue
        elif S[i][j] == "#":
            tate[i][j] = 0
        else:
            k = 0
            while S[i+k][j] == ".":
                k += 1
                if i+k == H:
                    break
            for l in range(k):
                tate[i+l][j] = k

#for i in range(H):
#    print(tate[i]) j range(W) range W for i in range(H):
        if tate[i][j] != 0:
            continue
        elif S[i][j] == "#":
            tate[i][j] = 0
        else:
            k = 0
            while S[i+k][j] == ".":
                k += 1
                if i+k == H:
                    break
            for l in range(k):
                tate[i+l][j] = k

#for i in range(H):
#    print(tate[i]) i range(H) range H if tate[i][j] != 0:
            continue
        elif S[i][j] == "#":
            tate[i][j] = 0
        else:
            k = 0
            while S[i+k][j] == ".":
                k += 1
                if i+k == H:
                    break
            for l in range(k):
                tate[i+l][j] = k

#for i in range(H):
#    print(tate[i]) tate[i][j] != 0 tate[i][j] [i] tate i j 0 continue elif S[i][j] == "#":
            tate[i][j] = 0
         S[i][j] == "#" S[i][j] [i] S i j "#" tate[i][j] = 0 tate[i][j] [i] tate i j 0 k = 0 k 0 while S[i+k][j] == ".":
                k += 1
                if i+k == H:
                    break
             S[i+k][j] == "." S[i+k][j] [i+k] S i+k i k j "." k += 1 k 1 if i+k == H:
                    break
             i+k == H i+k i k H break for l in range(k):
                tate[i+l][j] = k

#for i in range(H):
#    print(tate[i]) l range(k) range k tate[i+l][j] = k tate[i+l][j] [i+l] tate i+l i l j k ans = 0 ans 0 for i in range(H):
    for j in range(W):
        ans = max(ans, yoko[i][j] + tate[i][j] - 1) i range(H) range H for j in range(W):
        ans = max(ans, yoko[i][j] + tate[i][j] - 1) j range(W) range W ans = max(ans, yoko[i][j] + tate[i][j] - 1) ans max(ans, yoko[i][j] + tate[i][j] - 1) max ans yoko[i][j] + tate[i][j] - 1 yoko[i][j] + tate[i][j] yoko[i][j] [i] yoko i j tate[i][j] [i] tate i j 1 print(ans) print ans k += 1 1 k k = 0 0 k k = 0 0 k ans = 0 0 ans yoko = [[0] * W for i in range(H)] [[0] * W for i in range(H)] yoko W = map(int, input().split()) map(int, input().split()) W S = [0] * H [0] * H S tate = [[0] * W for i in range(H)] [[0] * W for i in range(H)] tate H, W = map(int, input().split()) map(int, input().split()) H ans = max(ans, yoko[i][j] + tate[i][j] - 1) max(ans, yoko[i][j] + tate[i][j] - 1) ans k += 1 1 k
H, W = map(int, input().split())
S = [0] * H
for i in range(H):
    S[i] = input()

yoko = [[0] * W for i in range(H)]

for i in range(H):
    for j in range(W):
        if yoko[i][j] != 0:
            continue
        elif S[i][j] == "#":
            yoko[i][j] = 0
        else:
            k = 0
            while S[i][j+k] == ".":
                k += 1
                if j+k == W:
                    break
            yoko[i][j:j+k] = [k] * k

tate = [[0] * W for i in range(H)]

for j in range(W):
    for i in range(H):
        if tate[i][j] != 0:
            continue
        elif S[i][j] == "#":
            tate[i][j] = 0
        else:
            k = 0
            while S[i+k][j] == ".":
                k += 1
                if i+k == H:
                    break
            for l in range(k):
                tate[i+l][j] = k

#for i in range(H):
#    print(tate[i])

ans = 0
for i in range(H):
    for j in range(W):
        ans = max(ans, yoko[i][j] + tate[i][j] - 1)

print(ans)