h, w = map(int, input().split())
data = [list(input()) for _ in range(h)]

cnt_l, cnt_r, cnt_u, cnt_d = [[0] * w for _ in range(h)], [[0] * w for _ in range(h)], [[0] * w for _ in range(h)], [[0] * w for _ in range(h)]

for i in range(h):
    for j in range(w):
        if data[i][j] == "#":
            cnt_l[i][j] = 0
        else:
            cnt_l[i][j] = cnt_l[i][j - 1] + 1
    
        if data[i][w - j - 1] == "#":
            cnt_r[i][w - j - 1] = 0
        else:
            if j == 0:
                cnt_r[i][w - j - 1] = 1
            else:
                cnt_r[i][w - j - 1] = cnt_r[i][w - j] + 1

for j in range(w):
    for i in range(h):
        if data[i][j] == "#":
            cnt_u[i][j] = 0
        else:
            cnt_u[i][j] = cnt_u[i - 1][j] + 1

        if data[h - i - 1][j] == "#":
            cnt_d[h - i - 1][j] = 0
        else:
            if i == 0:
                cnt_d[h - i - 1][j] = 1
            else:
                cnt_d[h - i - 1][j] = cnt_d[h - i][j] + 1

ans = 0
for i in range(h):
    for j in range(w):
        total= cnt_l[i][j] + cnt_r[i][j] + cnt_u[i][j] + cnt_d[i][j] - 3
        ans = max(ans, total)

print(ans) h, w = map(int, input().split()) h map(int, input().split()) map int input().split() ().split () input split w list(input()) for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) list(input()) list input() input data = [list(input()) for _ in range(h)] data [list(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 cnt_l, cnt_r, cnt_u, cnt_d = [[0] * w for _ in range(h)], [[0] * w for _ in range(h)], [[0] * w for _ in range(h)], [[0] * w for _ in range(h)] cnt_l [[0] * w for _ in range(h)] cnt_r [[0] * w for _ in range(h)] cnt_u [[0] * w for _ in range(h)] cnt_d [[0] * w for _ in range(h)] for i in range(h):
    for j in range(w):
        if data[i][j] == "#":
            cnt_l[i][j] = 0
        else:
            cnt_l[i][j] = cnt_l[i][j - 1] + 1
    
        if data[i][w - j - 1] == "#":
            cnt_r[i][w - j - 1] = 0
        else:
            if j == 0:
                cnt_r[i][w - j - 1] = 1
            else:
                cnt_r[i][w - j - 1] = cnt_r[i][w - j] + 1 i range(h) range h for j in range(w):
        if data[i][j] == "#":
            cnt_l[i][j] = 0
        else:
            cnt_l[i][j] = cnt_l[i][j - 1] + 1
    
        if data[i][w - j - 1] == "#":
            cnt_r[i][w - j - 1] = 0
        else:
            if j == 0:
                cnt_r[i][w - j - 1] = 1
            else:
                cnt_r[i][w - j - 1] = cnt_r[i][w - j] + 1 j range(w) range w if data[i][j] == "#":
            cnt_l[i][j] = 0
        else:
            cnt_l[i][j] = cnt_l[i][j - 1] + 1
    
         data[i][j] == "#" data[i][j] [i] data i j "#" cnt_l[i][j] = 0 cnt_l[i][j] [i] cnt_l i j 0 cnt_l[i][j] = cnt_l[i][j - 1] + 1 cnt_l[i][j] [i] cnt_l i j cnt_l[i][j - 1] + 1 cnt_l[i][j - 1] [i] cnt_l i j - 1 j 1 1 if data[i][w - j - 1] == "#":
            cnt_r[i][w - j - 1] = 0
        else:
            if j == 0:
                cnt_r[i][w - j - 1] = 1
            else:
                cnt_r[i][w - j - 1] = cnt_r[i][w - j] + 1 data[i][w - j - 1] == "#" data[i][w - j - 1] [i] data i w - j - 1 w - j w j 1 "#" cnt_r[i][w - j - 1] = 0 cnt_r[i][w - j - 1] [i] cnt_r i w - j - 1 w - j w j 1 0 if j == 0:
                cnt_r[i][w - j - 1] = 1
            else:
                cnt_r[i][w - j - 1] = cnt_r[i][w - j] + 1 j == 0 j 0 cnt_r[i][w - j - 1] = 1 cnt_r[i][w - j - 1] [i] cnt_r i w - j - 1 w - j w j 1 1 cnt_r[i][w - j - 1] = cnt_r[i][w - j] + 1 cnt_r[i][w - j - 1] [i] cnt_r i w - j - 1 w - j w j 1 cnt_r[i][w - j] + 1 cnt_r[i][w - j] [i] cnt_r i w - j w j 1 for j in range(w):
    for i in range(h):
        if data[i][j] == "#":
            cnt_u[i][j] = 0
        else:
            cnt_u[i][j] = cnt_u[i - 1][j] + 1

        if data[h - i - 1][j] == "#":
            cnt_d[h - i - 1][j] = 0
        else:
            if i == 0:
                cnt_d[h - i - 1][j] = 1
            else:
                cnt_d[h - i - 1][j] = cnt_d[h - i][j] + 1 j range(w) range w for i in range(h):
        if data[i][j] == "#":
            cnt_u[i][j] = 0
        else:
            cnt_u[i][j] = cnt_u[i - 1][j] + 1

        if data[h - i - 1][j] == "#":
            cnt_d[h - i - 1][j] = 0
        else:
            if i == 0:
                cnt_d[h - i - 1][j] = 1
            else:
                cnt_d[h - i - 1][j] = cnt_d[h - i][j] + 1 i range(h) range h if data[i][j] == "#":
            cnt_u[i][j] = 0
        else:
            cnt_u[i][j] = cnt_u[i - 1][j] + 1

         data[i][j] == "#" data[i][j] [i] data i j "#" cnt_u[i][j] = 0 cnt_u[i][j] [i] cnt_u i j 0 cnt_u[i][j] = cnt_u[i - 1][j] + 1 cnt_u[i][j] [i] cnt_u i j cnt_u[i - 1][j] + 1 cnt_u[i - 1][j] [i - 1] cnt_u i - 1 i 1 j 1 if data[h - i - 1][j] == "#":
            cnt_d[h - i - 1][j] = 0
        else:
            if i == 0:
                cnt_d[h - i - 1][j] = 1
            else:
                cnt_d[h - i - 1][j] = cnt_d[h - i][j] + 1 data[h - i - 1][j] == "#" data[h - i - 1][j] [h - i - 1] data h - i - 1 h - i h i 1 j "#" cnt_d[h - i - 1][j] = 0 cnt_d[h - i - 1][j] [h - i - 1] cnt_d h - i - 1 h - i h i 1 j 0 if i == 0:
                cnt_d[h - i - 1][j] = 1
            else:
                cnt_d[h - i - 1][j] = cnt_d[h - i][j] + 1 i == 0 i 0 cnt_d[h - i - 1][j] = 1 cnt_d[h - i - 1][j] [h - i - 1] cnt_d h - i - 1 h - i h i 1 j 1 cnt_d[h - i - 1][j] = cnt_d[h - i][j] + 1 cnt_d[h - i - 1][j] [h - i - 1] cnt_d h - i - 1 h - i h i 1 j cnt_d[h - i][j] + 1 cnt_d[h - i][j] [h - i] cnt_d h - i h i j 1 ans = 0 ans 0 for i in range(h):
    for j in range(w):
        total= cnt_l[i][j] + cnt_r[i][j] + cnt_u[i][j] + cnt_d[i][j] - 3
        ans = max(ans, total) i range(h) range h for j in range(w):
        total= cnt_l[i][j] + cnt_r[i][j] + cnt_u[i][j] + cnt_d[i][j] - 3
        ans = max(ans, total) j range(w) range w total= cnt_l[i][j] + cnt_r[i][j] + cnt_u[i][j] + cnt_d[i][j] - 3 total cnt_l[i][j] + cnt_r[i][j] + cnt_u[i][j] + cnt_d[i][j] - 3 cnt_l[i][j] + cnt_r[i][j] + cnt_u[i][j] + cnt_d[i][j] cnt_l[i][j] + cnt_r[i][j] + cnt_u[i][j] cnt_l[i][j] + cnt_r[i][j] cnt_l[i][j] [i] cnt_l i j cnt_r[i][j] [i] cnt_r i j cnt_u[i][j] [i] cnt_u i j cnt_d[i][j] [i] cnt_d i j 3 ans = max(ans, total) ans max(ans, total) max ans total print(ans) print ans cnt_l, cnt_r, cnt_u, cnt_d = [[0] * w for _ in range(h)], [[0] * w for _ in range(h)], [[0] * w for _ in range(h)], [[0] * w for _ in range(h)] [[0] * w for _ in range(h)] cnt_l cnt_r, cnt_u, cnt_d = [[0] * w for _ in range(h)], [[0] * w for _ in range(h)], [[0] * w for _ in range(h)], [[0] * w for _ in range(h)] [[0] * w for _ in range(h)] cnt_r h, w = map(int, input().split()) map(int, input().split()) h w = map(int, input().split()) map(int, input().split()) w data = [list(input()) for _ in range(h)] [list(input()) for _ in range(h)] data total= cnt_l[i][j] + cnt_r[i][j] + cnt_u[i][j] + cnt_d[i][j] - 3 cnt_l[i][j] + cnt_r[i][j] + cnt_u[i][j] + cnt_d[i][j] - 3 total ans = max(ans, total) max(ans, total) ans cnt_u, cnt_d = [[0] * w for _ in range(h)], [[0] * w for _ in range(h)], [[0] * w for _ in range(h)], [[0] * w for _ in range(h)] [[0] * w for _ in range(h)] cnt_u ans = 0 0 ans cnt_d = [[0] * w for _ in range(h)], [[0] * w for _ in range(h)], [[0] * w for _ in range(h)], [[0] * w for _ in range(h)] [[0] * w for _ in range(h)] cnt_d
h, w = map(int, input().split())
data = [list(input()) for _ in range(h)]

cnt_l, cnt_r, cnt_u, cnt_d = [[0] * w for _ in range(h)], [[0] * w for _ in range(h)], [[0] * w for _ in range(h)], [[0] * w for _ in range(h)]

for i in range(h):
    for j in range(w):
        if data[i][j] == "#":
            cnt_l[i][j] = 0
        else:
            cnt_l[i][j] = cnt_l[i][j - 1] + 1
    
        if data[i][w - j - 1] == "#":
            cnt_r[i][w - j - 1] = 0
        else:
            if j == 0:
                cnt_r[i][w - j - 1] = 1
            else:
                cnt_r[i][w - j - 1] = cnt_r[i][w - j] + 1

for j in range(w):
    for i in range(h):
        if data[i][j] == "#":
            cnt_u[i][j] = 0
        else:
            cnt_u[i][j] = cnt_u[i - 1][j] + 1

        if data[h - i - 1][j] == "#":
            cnt_d[h - i - 1][j] = 0
        else:
            if i == 0:
                cnt_d[h - i - 1][j] = 1
            else:
                cnt_d[h - i - 1][j] = cnt_d[h - i][j] + 1

ans = 0
for i in range(h):
    for j in range(w):
        total= cnt_l[i][j] + cnt_r[i][j] + cnt_u[i][j] + cnt_d[i][j] - 3
        ans = max(ans, total)

print(ans)