H, W = map(int, input().split())
S = [[c == "." for c in input()] for _ in range(H)]
to_right = [[0] * W for _ in range(H)]
to_left = [[0] * W for _ in range(H)]
for i in range(H):
    right = 0
    left = 0
    for j in range(W):
        if S[i][j]:
            right += 1
        else:
            right = 0
        to_right[i][j] = right
        if S[i][-(j + 1)]:
            left += 1
        else:
            left = 0
        to_left[i][-(j + 1)] = left
to_bottom = [[0] * W for _ in range(H)]
to_top = [[0] * W for _ in range(H)]
for j in range(W):
    bottom = 0
    top = 0
    for i in range(H):
        if S[i][j]:
            bottom += 1
        else:
            bottom = 0
        to_bottom[i][j] = bottom
        if S[-(i + 1)][j]:
            top += 1
        else:
            top = 0
        to_top[-(i + 1)][j] = top
ans = 0
for i in range(H):
    right = 0
    left = 0
    for j in range(W):
        if not S[i][j]:
            continue
        ans = max(ans, sum((to_right[i][j], to_left[i][j], to_bottom[i][j], to_top[i][j])))
print(ans - 3) H, W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W [c == "." for c in input()] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [c == "." for c in input()] S = [[c == "." for c in input()] for _ in range(H)] S [[c == "." for c in input()] for _ in range(H)] [0] * W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0] * W [0] 0 W to_right = [[0] * W for _ in range(H)] to_right [[0] * W for _ in range(H)] [0] * W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0] * W [0] 0 W to_left = [[0] * W for _ in range(H)] to_left [[0] * W for _ in range(H)] for i in range(H):
    right = 0
    left = 0
    for j in range(W):
        if S[i][j]:
            right += 1
        else:
            right = 0
        to_right[i][j] = right
        if S[i][-(j + 1)]:
            left += 1
        else:
            left = 0
        to_left[i][-(j + 1)] = left i range(H) range H right = 0 right 0 left = 0 left 0 for j in range(W):
        if S[i][j]:
            right += 1
        else:
            right = 0
        to_right[i][j] = right
        if S[i][-(j + 1)]:
            left += 1
        else:
            left = 0
        to_left[i][-(j + 1)] = left j range(W) range W if S[i][j]:
            right += 1
        else:
            right = 0
         S[i][j] [i] S i j right += 1 right 1 right = 0 right 0 to_right[i][j] = right to_right[i][j] [i] to_right i j right if S[i][-(j + 1)]:
            left += 1
        else:
            left = 0
         S[i][-(j + 1)] [i] S i -(j + 1) j + 1 j 1 left += 1 left 1 left = 0 left 0 to_left[i][-(j + 1)] = left to_left[i][-(j + 1)] [i] to_left i -(j + 1) j + 1 j 1 left [0] * W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0] * W [0] 0 W to_bottom = [[0] * W for _ in range(H)] to_bottom [[0] * W for _ in range(H)] [0] * W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0] * W [0] 0 W to_top = [[0] * W for _ in range(H)] to_top [[0] * W for _ in range(H)] for j in range(W):
    bottom = 0
    top = 0
    for i in range(H):
        if S[i][j]:
            bottom += 1
        else:
            bottom = 0
        to_bottom[i][j] = bottom
        if S[-(i + 1)][j]:
            top += 1
        else:
            top = 0
        to_top[-(i + 1)][j] = top j range(W) range W bottom = 0 bottom 0 top = 0 top 0 for i in range(H):
        if S[i][j]:
            bottom += 1
        else:
            bottom = 0
        to_bottom[i][j] = bottom
        if S[-(i + 1)][j]:
            top += 1
        else:
            top = 0
        to_top[-(i + 1)][j] = top i range(H) range H if S[i][j]:
            bottom += 1
        else:
            bottom = 0
         S[i][j] [i] S i j bottom += 1 bottom 1 bottom = 0 bottom 0 to_bottom[i][j] = bottom to_bottom[i][j] [i] to_bottom i j bottom if S[-(i + 1)][j]:
            top += 1
        else:
            top = 0
         S[-(i + 1)][j] [-(i + 1)] S -(i + 1) i + 1 i 1 j top += 1 top 1 top = 0 top 0 to_top[-(i + 1)][j] = top to_top[-(i + 1)][j] [-(i + 1)] to_top -(i + 1) i + 1 i 1 j top ans = 0 ans 0 for i in range(H):
    right = 0
    left = 0
    for j in range(W):
        if not S[i][j]:
            continue
        ans = max(ans, sum((to_right[i][j], to_left[i][j], to_bottom[i][j], to_top[i][j]))) i range(H) range H right = 0 right 0 left = 0 left 0 for j in range(W):
        if not S[i][j]:
            continue
        ans = max(ans, sum((to_right[i][j], to_left[i][j], to_bottom[i][j], to_top[i][j]))) j range(W) range W if not S[i][j]:
            continue
         not S[i][j] S[i][j] [i] S i j continue ans = max(ans, sum((to_right[i][j], to_left[i][j], to_bottom[i][j], to_top[i][j]))) ans max(ans, sum((to_right[i][j], to_left[i][j], to_bottom[i][j], to_top[i][j]))) max ans sum((to_right[i][j], to_left[i][j], to_bottom[i][j], to_top[i][j])) sum (to_right[i][j], to_left[i][j], to_bottom[i][j], to_top[i][j]) to_right[i][j] [i] to_right i j to_left[i][j] [i] to_left i j to_bottom[i][j] [i] to_bottom i j to_top[i][j] [i] to_top i j print(ans - 3) print ans - 3 ans 3 to_right = [[0] * W for _ in range(H)] [[0] * W for _ in range(H)] to_right bottom = 0 0 bottom W = map(int, input().split()) map(int, input().split()) W top = 0 0 top right = 0 0 right right += 1 1 right to_left = [[0] * W for _ in range(H)] [[0] * W for _ in range(H)] to_left bottom = 0 0 bottom left = 0 0 left left = 0 0 left right = 0 0 right left = 0 0 left right = 0 0 right top = 0 0 top to_top = [[0] * W for _ in range(H)] [[0] * W for _ in range(H)] to_top top += 1 1 top ans = max(ans, sum((to_right[i][j], to_left[i][j], to_bottom[i][j], to_top[i][j]))) max(ans, sum((to_right[i][j], to_left[i][j], to_bottom[i][j], to_top[i][j]))) ans H, W = map(int, input().split()) map(int, input().split()) H to_bottom = [[0] * W for _ in range(H)] [[0] * W for _ in range(H)] to_bottom ans = 0 0 ans left += 1 1 left S = [[c == "." for c in input()] for _ in range(H)] [[c == "." for c in input()] for _ in range(H)] S bottom += 1 1 bottom
H, W = map(int, input().split())
S = [[c == "." for c in input()] for _ in range(H)]
to_right = [[0] * W for _ in range(H)]
to_left = [[0] * W for _ in range(H)]
for i in range(H):
    right = 0
    left = 0
    for j in range(W):
        if S[i][j]:
            right += 1
        else:
            right = 0
        to_right[i][j] = right
        if S[i][-(j + 1)]:
            left += 1
        else:
            left = 0
        to_left[i][-(j + 1)] = left
to_bottom = [[0] * W for _ in range(H)]
to_top = [[0] * W for _ in range(H)]
for j in range(W):
    bottom = 0
    top = 0
    for i in range(H):
        if S[i][j]:
            bottom += 1
        else:
            bottom = 0
        to_bottom[i][j] = bottom
        if S[-(i + 1)][j]:
            top += 1
        else:
            top = 0
        to_top[-(i + 1)][j] = top
ans = 0
for i in range(H):
    right = 0
    left = 0
    for j in range(W):
        if not S[i][j]:
            continue
        ans = max(ans, sum((to_right[i][j], to_left[i][j], to_bottom[i][j], to_top[i][j])))
print(ans - 3)