h, w = map(int, input().split())
grid = []
for i in range(h):
    grid.append(list(input()))
up = [[0 for i in range(w)] for j in range(h)]
down = [[0 for i in range(w)] for j in range(h)]
right = [[0 for i in range(w)] for j in range(h)]
left = [[0 for i in range(w)] for j in range(h)]
for i in range(w):
    # init up
    if grid[0][i] == ".":
        up[0][i] = 1
    else:
        up[0][i] = 0
    #init down
    if grid[-1][i] == ".":
        down[-1][i] = 1
    else:
        down[-1][i] = 0
for i in range(h):
    #init right
    if grid[i][-1] == ".":
        right[i][-1] = 1
    else:
        right[i][-1] = 0
    
    #init left
    if grid[i][0] == ".":
        left[i][0] = 1
    else:
        left[i][0] = 0
for i in range(h):
    for j in range(1,w):
        if grid[i][j] == ".":
            left[i][j] = left[i][j-1] + 1
        else:
            left[i][j] = 0
for i in range(h):
    for j in range(w-2,-1,-1):
        if grid[i][j] == ".":
            right[i][j] = right[i][j+1] + 1
        else:
            right[i][j] = 0

for i in range(1,h):
    for j in range(w):
        if grid[i][j] == ".":
            up[i][j] = up[i-1][j] + 1
        else:
            up[i][j] = 0
for i in range(h-2,-1,-1):
    for j in range(w):
        if grid[i][j] == ".":
            down[i][j] = down[i+1][j] + 1
        else:
            down[i][j] = 0
ans = 0
for i in range(h):
    for j in range(w):
        ans = max(ans, up[i][j] + down[i][j] + left[i][j] + right[i][j] - 3)
print(ans) h, w = map(int, input().split()) h map(int, input().split()) map int input().split() ().split () input split w grid = [] grid [] for i in range(h):
    grid.append(list(input())) i range(h) range h grid.append(list(input())) grid.append grid append list(input()) list input() input [0 for i in range(w)] for j in range(h) for j in range(h) j range(h) range h for j in range(h) [0 for i in range(w)] up = [[0 for i in range(w)] for j in range(h)] up [[0 for i in range(w)] for j in range(h)] [0 for i in range(w)] for j in range(h) for j in range(h) j range(h) range h for j in range(h) [0 for i in range(w)] down = [[0 for i in range(w)] for j in range(h)] down [[0 for i in range(w)] for j in range(h)] [0 for i in range(w)] for j in range(h) for j in range(h) j range(h) range h for j in range(h) [0 for i in range(w)] right = [[0 for i in range(w)] for j in range(h)] right [[0 for i in range(w)] for j in range(h)] [0 for i in range(w)] for j in range(h) for j in range(h) j range(h) range h for j in range(h) [0 for i in range(w)] left = [[0 for i in range(w)] for j in range(h)] left [[0 for i in range(w)] for j in range(h)] for i in range(w):
    # init up
    if grid[0][i] == ".":
        up[0][i] = 1
    else:
        up[0][i] = 0
    #init down
    if grid[-1][i] == ".":
        down[-1][i] = 1
    else:
        down[-1][i] = 0 i range(w) range w if grid[0][i] == ".":
        up[0][i] = 1
    else:
        up[0][i] = 0
    #init down
     grid[0][i] == "." grid[0][i] [0] grid 0 i "." up[0][i] = 1 up[0][i] [0] up 0 i 1 up[0][i] = 0 up[0][i] [0] up 0 i 0 if grid[-1][i] == ".":
        down[-1][i] = 1
    else:
        down[-1][i] = 0 grid[-1][i] == "." grid[-1][i] [-1] grid -1 i "." down[-1][i] = 1 down[-1][i] [-1] down -1 i 1 down[-1][i] = 0 down[-1][i] [-1] down -1 i 0 for i in range(h):
    #init right
    if grid[i][-1] == ".":
        right[i][-1] = 1
    else:
        right[i][-1] = 0
    
    #init left
    if grid[i][0] == ".":
        left[i][0] = 1
    else:
        left[i][0] = 0 i range(h) range h if grid[i][-1] == ".":
        right[i][-1] = 1
    else:
        right[i][-1] = 0
    
    #init left
     grid[i][-1] == "." grid[i][-1] [i] grid i -1 "." right[i][-1] = 1 right[i][-1] [i] right i -1 1 right[i][-1] = 0 right[i][-1] [i] right i -1 0 if grid[i][0] == ".":
        left[i][0] = 1
    else:
        left[i][0] = 0 grid[i][0] == "." grid[i][0] [i] grid i 0 "." left[i][0] = 1 left[i][0] [i] left i 0 1 left[i][0] = 0 left[i][0] [i] left i 0 0 for i in range(h):
    for j in range(1,w):
        if grid[i][j] == ".":
            left[i][j] = left[i][j-1] + 1
        else:
            left[i][j] = 0 i range(h) range h for j in range(1,w):
        if grid[i][j] == ".":
            left[i][j] = left[i][j-1] + 1
        else:
            left[i][j] = 0 j range(1,w) range 1 w if grid[i][j] == ".":
            left[i][j] = left[i][j-1] + 1
        else:
            left[i][j] = 0 grid[i][j] == "." grid[i][j] [i] grid i j "." left[i][j] = left[i][j-1] + 1 left[i][j] [i] left i j left[i][j-1] + 1 left[i][j-1] [i] left i j-1 j 1 1 left[i][j] = 0 left[i][j] [i] left i j 0 for i in range(h):
    for j in range(w-2,-1,-1):
        if grid[i][j] == ".":
            right[i][j] = right[i][j+1] + 1
        else:
            right[i][j] = 0 i range(h) range h for j in range(w-2,-1,-1):
        if grid[i][j] == ".":
            right[i][j] = right[i][j+1] + 1
        else:
            right[i][j] = 0 j range(w-2,-1,-1) range w-2 w 2 -1 -1 if grid[i][j] == ".":
            right[i][j] = right[i][j+1] + 1
        else:
            right[i][j] = 0 grid[i][j] == "." grid[i][j] [i] grid i j "." right[i][j] = right[i][j+1] + 1 right[i][j] [i] right i j right[i][j+1] + 1 right[i][j+1] [i] right i j+1 j 1 1 right[i][j] = 0 right[i][j] [i] right i j 0 for i in range(1,h):
    for j in range(w):
        if grid[i][j] == ".":
            up[i][j] = up[i-1][j] + 1
        else:
            up[i][j] = 0 i range(1,h) range 1 h for j in range(w):
        if grid[i][j] == ".":
            up[i][j] = up[i-1][j] + 1
        else:
            up[i][j] = 0 j range(w) range w if grid[i][j] == ".":
            up[i][j] = up[i-1][j] + 1
        else:
            up[i][j] = 0 grid[i][j] == "." grid[i][j] [i] grid i j "." up[i][j] = up[i-1][j] + 1 up[i][j] [i] up i j up[i-1][j] + 1 up[i-1][j] [i-1] up i-1 i 1 j 1 up[i][j] = 0 up[i][j] [i] up i j 0 for i in range(h-2,-1,-1):
    for j in range(w):
        if grid[i][j] == ".":
            down[i][j] = down[i+1][j] + 1
        else:
            down[i][j] = 0 i range(h-2,-1,-1) range h-2 h 2 -1 -1 for j in range(w):
        if grid[i][j] == ".":
            down[i][j] = down[i+1][j] + 1
        else:
            down[i][j] = 0 j range(w) range w if grid[i][j] == ".":
            down[i][j] = down[i+1][j] + 1
        else:
            down[i][j] = 0 grid[i][j] == "." grid[i][j] [i] grid i j "." down[i][j] = down[i+1][j] + 1 down[i][j] [i] down i j down[i+1][j] + 1 down[i+1][j] [i+1] down i+1 i 1 j 1 down[i][j] = 0 down[i][j] [i] down i j 0 ans = 0 ans 0 for i in range(h):
    for j in range(w):
        ans = max(ans, up[i][j] + down[i][j] + left[i][j] + right[i][j] - 3) i range(h) range h for j in range(w):
        ans = max(ans, up[i][j] + down[i][j] + left[i][j] + right[i][j] - 3) j range(w) range w ans = max(ans, up[i][j] + down[i][j] + left[i][j] + right[i][j] - 3) ans max(ans, up[i][j] + down[i][j] + left[i][j] + right[i][j] - 3) max ans up[i][j] + down[i][j] + left[i][j] + right[i][j] - 3 up[i][j] + down[i][j] + left[i][j] + right[i][j] up[i][j] + down[i][j] + left[i][j] up[i][j] + down[i][j] up[i][j] [i] up i j down[i][j] [i] down i j left[i][j] [i] left i j right[i][j] [i] right i j 3 print(ans) print ans h, w = map(int, input().split()) map(int, input().split()) h down = [[0 for i in range(w)] for j in range(h)] [[0 for i in range(w)] for j in range(h)] down ans = 0 0 ans left = [[0 for i in range(w)] for j in range(h)] [[0 for i in range(w)] for j in range(h)] left ans = max(ans, up[i][j] + down[i][j] + left[i][j] + right[i][j] - 3) max(ans, up[i][j] + down[i][j] + left[i][j] + right[i][j] - 3) ans right = [[0 for i in range(w)] for j in range(h)] [[0 for i in range(w)] for j in range(h)] right w = map(int, input().split()) map(int, input().split()) w grid = [] [] grid up = [[0 for i in range(w)] for j in range(h)] [[0 for i in range(w)] for j in range(h)] up
h, w = map(int, input().split())
grid = []
for i in range(h):
    grid.append(list(input()))
up = [[0 for i in range(w)] for j in range(h)]
down = [[0 for i in range(w)] for j in range(h)]
right = [[0 for i in range(w)] for j in range(h)]
left = [[0 for i in range(w)] for j in range(h)]
for i in range(w):
    # init up
    if grid[0][i] == ".":
        up[0][i] = 1
    else:
        up[0][i] = 0
    #init down
    if grid[-1][i] == ".":
        down[-1][i] = 1
    else:
        down[-1][i] = 0
for i in range(h):
    #init right
    if grid[i][-1] == ".":
        right[i][-1] = 1
    else:
        right[i][-1] = 0
    
    #init left
    if grid[i][0] == ".":
        left[i][0] = 1
    else:
        left[i][0] = 0
for i in range(h):
    for j in range(1,w):
        if grid[i][j] == ".":
            left[i][j] = left[i][j-1] + 1
        else:
            left[i][j] = 0
for i in range(h):
    for j in range(w-2,-1,-1):
        if grid[i][j] == ".":
            right[i][j] = right[i][j+1] + 1
        else:
            right[i][j] = 0

for i in range(1,h):
    for j in range(w):
        if grid[i][j] == ".":
            up[i][j] = up[i-1][j] + 1
        else:
            up[i][j] = 0
for i in range(h-2,-1,-1):
    for j in range(w):
        if grid[i][j] == ".":
            down[i][j] = down[i+1][j] + 1
        else:
            down[i][j] = 0
ans = 0
for i in range(h):
    for j in range(w):
        ans = max(ans, up[i][j] + down[i][j] + left[i][j] + right[i][j] - 3)
print(ans)