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