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

dpl = [[1] * w for _ in range(h)]
dpr = [[1] * w for _ in range(h)]
dpu = [[1] * w for _ in range(h)]
dpd = [[1] * w for _ in range(h)]

for i, si in enumerate(s):
    for j, sij in enumerate(si):
        if sij == '#':
            dpl[i][j], dpu[i][j] = 0, 0
        elif sij == '.':
            if j - 1 >= 0:
                dpl[i][j] = dpl[i][j - 1] + 1
            if i - 1 >= 0:
                dpu[i][j] = dpu[i - 1][j] + 1
for i, si in enumerate(s[::-1]):
    i = h - i - 1
    for j, sij in enumerate(si[::-1]):
        j = w - j - 1
        if sij == '#':
            dpr[i][j], dpd[i][j] = 0, 0
        elif sij == '.':
            if j + 1 < w:
                dpr[i][j] = dpr[i][j + 1] + 1
            if i + 1 < h:
                dpd[i][j] = dpd[i + 1][j] + 1

ans = 0
for i in range(h):
    for j in range(w):
        cnt = dpl[i][j] + dpr[i][j] + dpu[i][j] + dpd[i][j]
        ans = max(ans, cnt)
print(ans - 3) 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] * w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [1] * w [1] 1 w dpl = [[1] * w for _ in range(h)] dpl [[1] * w for _ in range(h)] [1] * w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [1] * w [1] 1 w dpr = [[1] * w for _ in range(h)] dpr [[1] * w for _ in range(h)] [1] * w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [1] * w [1] 1 w dpu = [[1] * w for _ in range(h)] dpu [[1] * w for _ in range(h)] [1] * w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [1] * w [1] 1 w dpd = [[1] * w for _ in range(h)] dpd [[1] * w for _ in range(h)] for i, si in enumerate(s):
    for j, sij in enumerate(si):
        if sij == '#':
            dpl[i][j], dpu[i][j] = 0, 0
        elif sij == '.':
            if j - 1 >= 0:
                dpl[i][j] = dpl[i][j - 1] + 1
            if i - 1 >= 0:
                dpu[i][j] = dpu[i - 1][j] + 1 i si enumerate(s) enumerate s for j, sij in enumerate(si):
        if sij == '#':
            dpl[i][j], dpu[i][j] = 0, 0
        elif sij == '.':
            if j - 1 >= 0:
                dpl[i][j] = dpl[i][j - 1] + 1
            if i - 1 >= 0:
                dpu[i][j] = dpu[i - 1][j] + 1 j sij enumerate(si) enumerate si if sij == '#':
            dpl[i][j], dpu[i][j] = 0, 0
        elif sij == '.':
            if j - 1 >= 0:
                dpl[i][j] = dpl[i][j - 1] + 1
            if i - 1 >= 0:
                dpu[i][j] = dpu[i - 1][j] + 1 sij == '#' sij '#' dpl[i][j], dpu[i][j] = 0, 0 dpl[i][j] [i] dpl i j 0 dpu[i][j] [i] dpu i j 0 elif sij == '.':
            if j - 1 >= 0:
                dpl[i][j] = dpl[i][j - 1] + 1
            if i - 1 >= 0:
                dpu[i][j] = dpu[i - 1][j] + 1 sij == '.' sij '.' if j - 1 >= 0:
                dpl[i][j] = dpl[i][j - 1] + 1
             j - 1 >= 0 j - 1 j 1 0 dpl[i][j] = dpl[i][j - 1] + 1 dpl[i][j] [i] dpl i j dpl[i][j - 1] + 1 dpl[i][j - 1] [i] dpl i j - 1 j 1 1 if i - 1 >= 0:
                dpu[i][j] = dpu[i - 1][j] + 1 i - 1 >= 0 i - 1 i 1 0 dpu[i][j] = dpu[i - 1][j] + 1 dpu[i][j] [i] dpu i j dpu[i - 1][j] + 1 dpu[i - 1][j] [i - 1] dpu i - 1 i 1 j 1 for i, si in enumerate(s[::-1]):
    i = h - i - 1
    for j, sij in enumerate(si[::-1]):
        j = w - j - 1
        if sij == '#':
            dpr[i][j], dpd[i][j] = 0, 0
        elif sij == '.':
            if j + 1 < w:
                dpr[i][j] = dpr[i][j + 1] + 1
            if i + 1 < h:
                dpd[i][j] = dpd[i + 1][j] + 1 i si enumerate(s[::-1]) enumerate s[::-1] s ::-1 -1 i = h - i - 1 i h - i - 1 h - i h i 1 for j, sij in enumerate(si[::-1]):
        j = w - j - 1
        if sij == '#':
            dpr[i][j], dpd[i][j] = 0, 0
        elif sij == '.':
            if j + 1 < w:
                dpr[i][j] = dpr[i][j + 1] + 1
            if i + 1 < h:
                dpd[i][j] = dpd[i + 1][j] + 1 j sij enumerate(si[::-1]) enumerate si[::-1] si ::-1 -1 j = w - j - 1 j w - j - 1 w - j w j 1 if sij == '#':
            dpr[i][j], dpd[i][j] = 0, 0
        elif sij == '.':
            if j + 1 < w:
                dpr[i][j] = dpr[i][j + 1] + 1
            if i + 1 < h:
                dpd[i][j] = dpd[i + 1][j] + 1 sij == '#' sij '#' dpr[i][j], dpd[i][j] = 0, 0 dpr[i][j] [i] dpr i j 0 dpd[i][j] [i] dpd i j 0 elif sij == '.':
            if j + 1 < w:
                dpr[i][j] = dpr[i][j + 1] + 1
            if i + 1 < h:
                dpd[i][j] = dpd[i + 1][j] + 1 sij == '.' sij '.' if j + 1 < w:
                dpr[i][j] = dpr[i][j + 1] + 1
             j + 1 < w j + 1 j 1 w dpr[i][j] = dpr[i][j + 1] + 1 dpr[i][j] [i] dpr i j dpr[i][j + 1] + 1 dpr[i][j + 1] [i] dpr i j + 1 j 1 1 if i + 1 < h:
                dpd[i][j] = dpd[i + 1][j] + 1 i + 1 < h i + 1 i 1 h dpd[i][j] = dpd[i + 1][j] + 1 dpd[i][j] [i] dpd i j dpd[i + 1][j] + 1 dpd[i + 1][j] [i + 1] dpd i + 1 i 1 j 1 ans = 0 ans 0 for i in range(h):
    for j in range(w):
        cnt = dpl[i][j] + dpr[i][j] + dpu[i][j] + dpd[i][j]
        ans = max(ans, cnt) i range(h) range h for j in range(w):
        cnt = dpl[i][j] + dpr[i][j] + dpu[i][j] + dpd[i][j]
        ans = max(ans, cnt) j range(w) range w cnt = dpl[i][j] + dpr[i][j] + dpu[i][j] + dpd[i][j] cnt dpl[i][j] + dpr[i][j] + dpu[i][j] + dpd[i][j] dpl[i][j] + dpr[i][j] + dpu[i][j] dpl[i][j] + dpr[i][j] dpl[i][j] [i] dpl i j dpr[i][j] [i] dpr i j dpu[i][j] [i] dpu i j dpd[i][j] [i] dpd i j ans = max(ans, cnt) ans max(ans, cnt) max ans cnt print(ans - 3) print ans - 3 ans 3 w = map(int, input().split()) map(int, input().split()) w h, w = map(int, input().split()) map(int, input().split()) h ans = 0 0 ans dpl = [[1] * w for _ in range(h)] [[1] * w for _ in range(h)] dpl j = w - j - 1 w - j - 1 j i = h - i - 1 h - i - 1 i s = [input() for _ in range(h)] [input() for _ in range(h)] s dpu = [[1] * w for _ in range(h)] [[1] * w for _ in range(h)] dpu dpd = [[1] * w for _ in range(h)] [[1] * w for _ in range(h)] dpd cnt = dpl[i][j] + dpr[i][j] + dpu[i][j] + dpd[i][j] dpl[i][j] + dpr[i][j] + dpu[i][j] + dpd[i][j] cnt ans = max(ans, cnt) max(ans, cnt) ans dpr = [[1] * w for _ in range(h)] [[1] * w for _ in range(h)] dpr
h, w = map(int, input().split())
s = [input() for _ in range(h)]

dpl = [[1] * w for _ in range(h)]
dpr = [[1] * w for _ in range(h)]
dpu = [[1] * w for _ in range(h)]
dpd = [[1] * w for _ in range(h)]

for i, si in enumerate(s):
    for j, sij in enumerate(si):
        if sij == '#':
            dpl[i][j], dpu[i][j] = 0, 0
        elif sij == '.':
            if j - 1 >= 0:
                dpl[i][j] = dpl[i][j - 1] + 1
            if i - 1 >= 0:
                dpu[i][j] = dpu[i - 1][j] + 1
for i, si in enumerate(s[::-1]):
    i = h - i - 1
    for j, sij in enumerate(si[::-1]):
        j = w - j - 1
        if sij == '#':
            dpr[i][j], dpd[i][j] = 0, 0
        elif sij == '.':
            if j + 1 < w:
                dpr[i][j] = dpr[i][j + 1] + 1
            if i + 1 < h:
                dpd[i][j] = dpd[i + 1][j] + 1

ans = 0
for i in range(h):
    for j in range(w):
        cnt = dpl[i][j] + dpr[i][j] + dpu[i][j] + dpd[i][j]
        ans = max(ans, cnt)
print(ans - 3)
