h, w = map(int, input().split())
s = []
for i in range(h):
    s.append(list(input()))

right = [[0]*w for _ in range(h)]
left = [[0]*w for _ in range(h)]
up = [[0]*w for _ in range(h)]
down = [[0]*w for _ in range(h)]

for i in range(h):
    if s[i][0] == ".":
        left[i][0] = 1
    if s[i][w-1] == ".":
        right[i][w-1] = 1

for j in range(w):
    if s[0][j] == ".":
        down[0][j] = 1
    if s[h-1][j] == ".":
        up[h-1][j] = 1
        
for i in range(h):
    for j in range(w):
        if s[i][j] == ".":
            if j > 0:
                left[i][j] = left[i][j-1] + 1
            if i > 0:
                down[i][j] = down[i-1][j] + 1

for i in range(h)[::-1]:
    for j in range(w)[::-1]:
        if s[i][j] == ".":
            if i < h-1:
                up[i][j] = up[i+1][j] + 1
            if j < w-1:
                right[i][j] = right[i][j+1] + 1
ans = 0
for i in range(h):
    for j in range(w):
        count = left[i][j] + right[i][j] + up[i][j] + down[i][j] - 3
        if ans < count:
            ans = count
print(ans) h, w = map(int, input().split()) h map(int, input().split()) map int input().split() ().split () input split w s = [] s [] for i in range(h):
    s.append(list(input())) i range(h) range h s.append(list(input())) s.append s append list(input()) list input() input [0]*w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0]*w [0] 0 w right = [[0]*w for _ in range(h)] 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 left = [[0]*w for _ in range(h)] left [[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 up = [[0]*w for _ in range(h)] up [[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 down = [[0]*w for _ in range(h)] down [[0]*w for _ in range(h)] for i in range(h):
    if s[i][0] == ".":
        left[i][0] = 1
    if s[i][w-1] == ".":
        right[i][w-1] = 1 i range(h) range h if s[i][0] == ".":
        left[i][0] = 1
     s[i][0] == "." s[i][0] [i] s i 0 "." left[i][0] = 1 left[i][0] [i] left i 0 1 if s[i][w-1] == ".":
        right[i][w-1] = 1 s[i][w-1] == "." s[i][w-1] [i] s i w-1 w 1 "." right[i][w-1] = 1 right[i][w-1] [i] right i w-1 w 1 1 for j in range(w):
    if s[0][j] == ".":
        down[0][j] = 1
    if s[h-1][j] == ".":
        up[h-1][j] = 1
         j range(w) range w if s[0][j] == ".":
        down[0][j] = 1
     s[0][j] == "." s[0][j] [0] s 0 j "." down[0][j] = 1 down[0][j] [0] down 0 j 1 if s[h-1][j] == ".":
        up[h-1][j] = 1
         s[h-1][j] == "." s[h-1][j] [h-1] s h-1 h 1 j "." up[h-1][j] = 1 up[h-1][j] [h-1] up h-1 h 1 j 1 for i in range(h):
    for j in range(w):
        if s[i][j] == ".":
            if j > 0:
                left[i][j] = left[i][j-1] + 1
            if i > 0:
                down[i][j] = down[i-1][j] + 1 i range(h) range h for j in range(w):
        if s[i][j] == ".":
            if j > 0:
                left[i][j] = left[i][j-1] + 1
            if i > 0:
                down[i][j] = down[i-1][j] + 1 j range(w) range w if s[i][j] == ".":
            if j > 0:
                left[i][j] = left[i][j-1] + 1
            if i > 0:
                down[i][j] = down[i-1][j] + 1 s[i][j] == "." s[i][j] [i] s i j "." if j > 0:
                left[i][j] = left[i][j-1] + 1
             j > 0 j 0 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 if i > 0:
                down[i][j] = down[i-1][j] + 1 i > 0 i 0 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 for i in range(h)[::-1]:
    for j in range(w)[::-1]:
        if s[i][j] == ".":
            if i < h-1:
                up[i][j] = up[i+1][j] + 1
            if j < w-1:
                right[i][j] = right[i][j+1] + 1 i range(h)[::-1] (h) range h ::-1 -1 for j in range(w)[::-1]:
        if s[i][j] == ".":
            if i < h-1:
                up[i][j] = up[i+1][j] + 1
            if j < w-1:
                right[i][j] = right[i][j+1] + 1 j range(w)[::-1] (w) range w ::-1 -1 if s[i][j] == ".":
            if i < h-1:
                up[i][j] = up[i+1][j] + 1
            if j < w-1:
                right[i][j] = right[i][j+1] + 1 s[i][j] == "." s[i][j] [i] s i j "." if i < h-1:
                up[i][j] = up[i+1][j] + 1
             i < h-1 i h-1 h 1 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 if j < w-1:
                right[i][j] = right[i][j+1] + 1 j < w-1 j w-1 w 1 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 ans = 0 ans 0 for i in range(h):
    for j in range(w):
        count = left[i][j] + right[i][j] + up[i][j] + down[i][j] - 3
        if ans < count:
            ans = count i range(h) range h for j in range(w):
        count = left[i][j] + right[i][j] + up[i][j] + down[i][j] - 3
        if ans < count:
            ans = count j range(w) range w count = left[i][j] + right[i][j] + up[i][j] + down[i][j] - 3 count left[i][j] + right[i][j] + up[i][j] + down[i][j] - 3 left[i][j] + right[i][j] + up[i][j] + down[i][j] left[i][j] + right[i][j] + up[i][j] left[i][j] + right[i][j] left[i][j] [i] left i j right[i][j] [i] right i j up[i][j] [i] up i j down[i][j] [i] down i j 3 if ans < count:
            ans = count ans < count ans count ans = count ans count print(ans) print ans ans = count count ans s = [] [] s up = [[0]*w for _ in range(h)] [[0]*w for _ in range(h)] up w = map(int, input().split()) map(int, input().split()) w h, w = map(int, input().split()) map(int, input().split()) h left = [[0]*w for _ in range(h)] [[0]*w for _ in range(h)] left down = [[0]*w for _ in range(h)] [[0]*w for _ in range(h)] down right = [[0]*w for _ in range(h)] [[0]*w for _ in range(h)] right ans = 0 0 ans count = left[i][j] + right[i][j] + up[i][j] + down[i][j] - 3 left[i][j] + right[i][j] + up[i][j] + down[i][j] - 3 count
h, w = map(int, input().split())
s = []
for i in range(h):
    s.append(list(input()))

right = [[0]*w for _ in range(h)]
left = [[0]*w for _ in range(h)]
up = [[0]*w for _ in range(h)]
down = [[0]*w for _ in range(h)]

for i in range(h):
    if s[i][0] == ".":
        left[i][0] = 1
    if s[i][w-1] == ".":
        right[i][w-1] = 1

for j in range(w):
    if s[0][j] == ".":
        down[0][j] = 1
    if s[h-1][j] == ".":
        up[h-1][j] = 1
        
for i in range(h):
    for j in range(w):
        if s[i][j] == ".":
            if j > 0:
                left[i][j] = left[i][j-1] + 1
            if i > 0:
                down[i][j] = down[i-1][j] + 1

for i in range(h)[::-1]:
    for j in range(w)[::-1]:
        if s[i][j] == ".":
            if i < h-1:
                up[i][j] = up[i+1][j] + 1
            if j < w-1:
                right[i][j] = right[i][j+1] + 1
ans = 0
for i in range(h):
    for j in range(w):
        count = left[i][j] + right[i][j] + up[i][j] + down[i][j] - 3
        if ans < count:
            ans = count
print(ans)