H, W = map(int, input().split())
S = [input() for _ in range(H)]
Ans = [[[-1, -1]for __ in range(W)] for _ in range(H)]
ans = 0
for i in range(H):
    for j in range(W):
        if S[i][j] == '#':
            continue
        else:
            if Ans[i-1][j][0] != -1:
                Ans[i][j][0] = Ans[i-1][j][0]
            else:
                num0 = 0
                while True:
                    num0 += 1
                    if i + num0 >= H:
                        break
                    elif S[i+num0][j] == '#':
                        break
                Ans[i][j][0] = num0

            if Ans[i][j-1][1] != -1:
                Ans[i][j][1] = Ans[i][j-1][1]
            else:
                num1 = 0
                while True:
                    num1 += 1
                    if j + num1 >= W:
                        break
                    elif S[i][j+num1] == '#':
                        break
                Ans[i][j][1] = num1

        ans = max(ans, sum(Ans[i][j]))
print(ans-1) H, W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W input() for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) input() input S = [input() for _ in range(H)] S [input() for _ in range(H)] [[-1, -1]for __ in range(W)] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [[-1, -1]for __ in range(W)] Ans = [[[-1, -1]for __ in range(W)] for _ in range(H)] Ans [[[-1, -1]for __ in range(W)] for _ in range(H)] ans = 0 ans 0 for i in range(H):
    for j in range(W):
        if S[i][j] == '#':
            continue
        else:
            if Ans[i-1][j][0] != -1:
                Ans[i][j][0] = Ans[i-1][j][0]
            else:
                num0 = 0
                while True:
                    num0 += 1
                    if i + num0 >= H:
                        break
                    elif S[i+num0][j] == '#':
                        break
                Ans[i][j][0] = num0

            if Ans[i][j-1][1] != -1:
                Ans[i][j][1] = Ans[i][j-1][1]
            else:
                num1 = 0
                while True:
                    num1 += 1
                    if j + num1 >= W:
                        break
                    elif S[i][j+num1] == '#':
                        break
                Ans[i][j][1] = num1

        ans = max(ans, sum(Ans[i][j])) i range(H) range H for j in range(W):
        if S[i][j] == '#':
            continue
        else:
            if Ans[i-1][j][0] != -1:
                Ans[i][j][0] = Ans[i-1][j][0]
            else:
                num0 = 0
                while True:
                    num0 += 1
                    if i + num0 >= H:
                        break
                    elif S[i+num0][j] == '#':
                        break
                Ans[i][j][0] = num0

            if Ans[i][j-1][1] != -1:
                Ans[i][j][1] = Ans[i][j-1][1]
            else:
                num1 = 0
                while True:
                    num1 += 1
                    if j + num1 >= W:
                        break
                    elif S[i][j+num1] == '#':
                        break
                Ans[i][j][1] = num1

        ans = max(ans, sum(Ans[i][j])) j range(W) range W if S[i][j] == '#':
            continue
        else:
            if Ans[i-1][j][0] != -1:
                Ans[i][j][0] = Ans[i-1][j][0]
            else:
                num0 = 0
                while True:
                    num0 += 1
                    if i + num0 >= H:
                        break
                    elif S[i+num0][j] == '#':
                        break
                Ans[i][j][0] = num0

            if Ans[i][j-1][1] != -1:
                Ans[i][j][1] = Ans[i][j-1][1]
            else:
                num1 = 0
                while True:
                    num1 += 1
                    if j + num1 >= W:
                        break
                    elif S[i][j+num1] == '#':
                        break
                Ans[i][j][1] = num1

         S[i][j] == '#' S[i][j] [i] S i j '#' continue if Ans[i-1][j][0] != -1:
                Ans[i][j][0] = Ans[i-1][j][0]
            else:
                num0 = 0
                while True:
                    num0 += 1
                    if i + num0 >= H:
                        break
                    elif S[i+num0][j] == '#':
                        break
                Ans[i][j][0] = num0

             Ans[i-1][j][0] != -1 Ans[i-1][j][0] [j] [i-1] Ans i-1 i 1 j 0 -1 Ans[i][j][0] = Ans[i-1][j][0] Ans[i][j][0] [j] [i] Ans i j 0 Ans[i-1][j][0] [j] [i-1] Ans i-1 i 1 j 0 num0 = 0 num0 0 while True:
                    num0 += 1
                    if i + num0 >= H:
                        break
                    elif S[i+num0][j] == '#':
                        break
                 True num0 += 1 num0 1 if i + num0 >= H:
                        break
                    elif S[i+num0][j] == '#':
                        break
                 i + num0 >= H i + num0 i num0 H break elif S[i+num0][j] == '#':
                        break
                 S[i+num0][j] == '#' S[i+num0][j] [i+num0] S i+num0 i num0 j '#' break Ans[i][j][0] = num0 Ans[i][j][0] [j] [i] Ans i j 0 num0 if Ans[i][j-1][1] != -1:
                Ans[i][j][1] = Ans[i][j-1][1]
            else:
                num1 = 0
                while True:
                    num1 += 1
                    if j + num1 >= W:
                        break
                    elif S[i][j+num1] == '#':
                        break
                Ans[i][j][1] = num1

         Ans[i][j-1][1] != -1 Ans[i][j-1][1] [j-1] [i] Ans i j-1 j 1 1 -1 Ans[i][j][1] = Ans[i][j-1][1] Ans[i][j][1] [j] [i] Ans i j 1 Ans[i][j-1][1] [j-1] [i] Ans i j-1 j 1 1 num1 = 0 num1 0 while True:
                    num1 += 1
                    if j + num1 >= W:
                        break
                    elif S[i][j+num1] == '#':
                        break
                 True num1 += 1 num1 1 if j + num1 >= W:
                        break
                    elif S[i][j+num1] == '#':
                        break
                 j + num1 >= W j + num1 j num1 W break elif S[i][j+num1] == '#':
                        break
                 S[i][j+num1] == '#' S[i][j+num1] [i] S i j+num1 j num1 '#' break Ans[i][j][1] = num1 Ans[i][j][1] [j] [i] Ans i j 1 num1 ans = max(ans, sum(Ans[i][j])) ans max(ans, sum(Ans[i][j])) max ans sum(Ans[i][j]) sum Ans[i][j] [i] Ans i j print(ans-1) print ans-1 ans 1 num0 += 1 1 num0 num1 += 1 1 num1 H, W = map(int, input().split()) map(int, input().split()) H num1 = 0 0 num1 W = map(int, input().split()) map(int, input().split()) W S = [input() for _ in range(H)] [input() for _ in range(H)] S Ans = [[[-1, -1]for __ in range(W)] for _ in range(H)] [[[-1, -1]for __ in range(W)] for _ in range(H)] Ans ans = max(ans, sum(Ans[i][j])) max(ans, sum(Ans[i][j])) ans num0 = 0 0 num0 ans = 0 0 ans
H, W = map(int, input().split())
S = [input() for _ in range(H)]
Ans = [[[-1, -1]for __ in range(W)] for _ in range(H)]
ans = 0
for i in range(H):
    for j in range(W):
        if S[i][j] == '#':
            continue
        else:
            if Ans[i-1][j][0] != -1:
                Ans[i][j][0] = Ans[i-1][j][0]
            else:
                num0 = 0
                while True:
                    num0 += 1
                    if i + num0 >= H:
                        break
                    elif S[i+num0][j] == '#':
                        break
                Ans[i][j][0] = num0

            if Ans[i][j-1][1] != -1:
                Ans[i][j][1] = Ans[i][j-1][1]
            else:
                num1 = 0
                while True:
                    num1 += 1
                    if j + num1 >= W:
                        break
                    elif S[i][j+num1] == '#':
                        break
                Ans[i][j][1] = num1

        ans = max(ans, sum(Ans[i][j]))
print(ans-1)
