H, W = map(int,input().split())
s = []
rc = [[[None]*W for _ in range(H)] for _ in range(2)]
for _ in range(H):
    s.append(list(input()))
for j in range(H):
    l = s[j]
    for i in range(W):
        if l[i] == "#":
            rc[0][j][i] = 0
        elif i > 0:
            rc[0][j][i] = rc[0][j][i-1] + 1
        else:
            rc[0][j][i] = 1
    for i in range(W-1, -1, -1):
        if l[i] == "#":
            continue
        elif i < W-1:
            rc[0][j][i] = max(rc[0][j][i+1], rc[0][j][i])
for i in range(W):
    for j in range(H):
        if s[j][i] == "#":
            rc[1][j][i] = 0
        elif j > 0:
            rc[1][j][i] = rc[1][j-1][i] + 1
        else:
            rc[1][j][i] = 1
    for j in range(H-1, -1, -1):
        if s[j][i] == "#":
            continue
        elif j < H-1:
            rc[1][j][i] = max(rc[1][j+1][i], rc[1][j][i])
ans = 0
for j in range(H):
    for i in range(W):
        ans = max(rc[0][j][i] + rc[1][j][i] - 1, ans)
print(ans) H, W = map(int,input().split()) H map(int,input().split()) map int input().split() ().split () input split W s = [] s [] [[None]*W for _ in range(H)] for _ in range(2) for _ in range(2) _ range(2) range 2 for _ in range(2) [[None]*W for _ in range(H)] rc = [[[None]*W for _ in range(H)] for _ in range(2)] rc [[[None]*W for _ in range(H)] for _ in range(2)] for _ in range(H):
    s.append(list(input())) _ range(H) range H s.append(list(input())) s.append s append list(input()) list input() input for j in range(H):
    l = s[j]
    for i in range(W):
        if l[i] == "#":
            rc[0][j][i] = 0
        elif i > 0:
            rc[0][j][i] = rc[0][j][i-1] + 1
        else:
            rc[0][j][i] = 1
    for i in range(W-1, -1, -1):
        if l[i] == "#":
            continue
        elif i < W-1:
            rc[0][j][i] = max(rc[0][j][i+1], rc[0][j][i]) j range(H) range H l = s[j] l s[j] s j for i in range(W):
        if l[i] == "#":
            rc[0][j][i] = 0
        elif i > 0:
            rc[0][j][i] = rc[0][j][i-1] + 1
        else:
            rc[0][j][i] = 1
     i range(W) range W if l[i] == "#":
            rc[0][j][i] = 0
        elif i > 0:
            rc[0][j][i] = rc[0][j][i-1] + 1
        else:
            rc[0][j][i] = 1
     l[i] == "#" l[i] l i "#" rc[0][j][i] = 0 rc[0][j][i] [j] [0] rc 0 j i 0 elif i > 0:
            rc[0][j][i] = rc[0][j][i-1] + 1
         i > 0 i 0 rc[0][j][i] = rc[0][j][i-1] + 1 rc[0][j][i] [j] [0] rc 0 j i rc[0][j][i-1] + 1 rc[0][j][i-1] [j] [0] rc 0 j i-1 i 1 1 rc[0][j][i] = 1 rc[0][j][i] [j] [0] rc 0 j i 1 for i in range(W-1, -1, -1):
        if l[i] == "#":
            continue
        elif i < W-1:
            rc[0][j][i] = max(rc[0][j][i+1], rc[0][j][i]) i range(W-1, -1, -1) range W-1 W 1 -1 -1 if l[i] == "#":
            continue
        elif i < W-1:
            rc[0][j][i] = max(rc[0][j][i+1], rc[0][j][i]) l[i] == "#" l[i] l i "#" continue elif i < W-1:
            rc[0][j][i] = max(rc[0][j][i+1], rc[0][j][i]) i < W-1 i W-1 W 1 rc[0][j][i] = max(rc[0][j][i+1], rc[0][j][i]) rc[0][j][i] [j] [0] rc 0 j i max(rc[0][j][i+1], rc[0][j][i]) max rc[0][j][i+1] [j] [0] rc 0 j i+1 i 1 rc[0][j][i] [j] [0] rc 0 j i for i in range(W):
    for j in range(H):
        if s[j][i] == "#":
            rc[1][j][i] = 0
        elif j > 0:
            rc[1][j][i] = rc[1][j-1][i] + 1
        else:
            rc[1][j][i] = 1
    for j in range(H-1, -1, -1):
        if s[j][i] == "#":
            continue
        elif j < H-1:
            rc[1][j][i] = max(rc[1][j+1][i], rc[1][j][i]) i range(W) range W for j in range(H):
        if s[j][i] == "#":
            rc[1][j][i] = 0
        elif j > 0:
            rc[1][j][i] = rc[1][j-1][i] + 1
        else:
            rc[1][j][i] = 1
     j range(H) range H if s[j][i] == "#":
            rc[1][j][i] = 0
        elif j > 0:
            rc[1][j][i] = rc[1][j-1][i] + 1
        else:
            rc[1][j][i] = 1
     s[j][i] == "#" s[j][i] [j] s j i "#" rc[1][j][i] = 0 rc[1][j][i] [j] [1] rc 1 j i 0 elif j > 0:
            rc[1][j][i] = rc[1][j-1][i] + 1
         j > 0 j 0 rc[1][j][i] = rc[1][j-1][i] + 1 rc[1][j][i] [j] [1] rc 1 j i rc[1][j-1][i] + 1 rc[1][j-1][i] [j-1] [1] rc 1 j-1 j 1 i 1 rc[1][j][i] = 1 rc[1][j][i] [j] [1] rc 1 j i 1 for j in range(H-1, -1, -1):
        if s[j][i] == "#":
            continue
        elif j < H-1:
            rc[1][j][i] = max(rc[1][j+1][i], rc[1][j][i]) j range(H-1, -1, -1) range H-1 H 1 -1 -1 if s[j][i] == "#":
            continue
        elif j < H-1:
            rc[1][j][i] = max(rc[1][j+1][i], rc[1][j][i]) s[j][i] == "#" s[j][i] [j] s j i "#" continue elif j < H-1:
            rc[1][j][i] = max(rc[1][j+1][i], rc[1][j][i]) j < H-1 j H-1 H 1 rc[1][j][i] = max(rc[1][j+1][i], rc[1][j][i]) rc[1][j][i] [j] [1] rc 1 j i max(rc[1][j+1][i], rc[1][j][i]) max rc[1][j+1][i] [j+1] [1] rc 1 j+1 j 1 i rc[1][j][i] [j] [1] rc 1 j i ans = 0 ans 0 for j in range(H):
    for i in range(W):
        ans = max(rc[0][j][i] + rc[1][j][i] - 1, ans) j range(H) range H for i in range(W):
        ans = max(rc[0][j][i] + rc[1][j][i] - 1, ans) i range(W) range W ans = max(rc[0][j][i] + rc[1][j][i] - 1, ans) ans max(rc[0][j][i] + rc[1][j][i] - 1, ans) max rc[0][j][i] + rc[1][j][i] - 1 rc[0][j][i] + rc[1][j][i] rc[0][j][i] [j] [0] rc 0 j i rc[1][j][i] [j] [1] rc 1 j i 1 ans print(ans) print ans rc = [[[None]*W for _ in range(H)] for _ in range(2)] [[[None]*W for _ in range(H)] for _ in range(2)] rc ans = max(rc[0][j][i] + rc[1][j][i] - 1, ans) max(rc[0][j][i] + rc[1][j][i] - 1, ans) ans ans = 0 0 ans s = [] [] s W = map(int,input().split()) map(int,input().split()) W H, W = map(int,input().split()) map(int,input().split()) H l = s[j] s[j] l
H, W = map(int,input().split())
s = []
rc = [[[None]*W for _ in range(H)] for _ in range(2)]
for _ in range(H):
    s.append(list(input()))
for j in range(H):
    l = s[j]
    for i in range(W):
        if l[i] == "#":
            rc[0][j][i] = 0
        elif i > 0:
            rc[0][j][i] = rc[0][j][i-1] + 1
        else:
            rc[0][j][i] = 1
    for i in range(W-1, -1, -1):
        if l[i] == "#":
            continue
        elif i < W-1:
            rc[0][j][i] = max(rc[0][j][i+1], rc[0][j][i])
for i in range(W):
    for j in range(H):
        if s[j][i] == "#":
            rc[1][j][i] = 0
        elif j > 0:
            rc[1][j][i] = rc[1][j-1][i] + 1
        else:
            rc[1][j][i] = 1
    for j in range(H-1, -1, -1):
        if s[j][i] == "#":
            continue
        elif j < H-1:
            rc[1][j][i] = max(rc[1][j+1][i], rc[1][j][i])
ans = 0
for j in range(H):
    for i in range(W):
        ans = max(rc[0][j][i] + rc[1][j][i] - 1, ans)
print(ans)