h, w = map(int, input().split())

mtx = [input() for _ in range(h)]

ret_mtx1 = [[0] * w for _ in range(h)]
ret_mtx2 = [[0] * w for _ in range(h)]
ret_mtx3 = [[0] * w for _ in range(h)]
ret_mtx4 = [[0] * w for _ in range(h)]

# left 2 right
for i in range(h):
    for j in range(w):
        if mtx[i][j] == '.':
            ret_mtx1[i][j] = 1 if i == 0 else ret_mtx1[i-1][j] + 1
            ret_mtx2[i][j] = 1 if j == 0 else ret_mtx2[i][j-1] + 1
        if mtx[-1-i][-1-j] == '.':
            ret_mtx3[-1-i][-1-j] = 1 if i == 0 else ret_mtx3[-i][-1-j] + 1
            ret_mtx4[-1-i][-1-j] = 1 if j == 0 else ret_mtx4[-1-i][-j] + 1

ret = 0

for i in range(h):
    for j in range(w):
        tmp = ret_mtx1[i][j] + ret_mtx2[i][j] + \
            ret_mtx3[i][j] + ret_mtx4[i][j] - 3
        ret = max(ret, tmp)

print(ret) 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 mtx = [input() for _ in range(h)] mtx [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 ret_mtx1 = [[0] * w for _ in range(h)] ret_mtx1 [[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 ret_mtx2 = [[0] * w for _ in range(h)] ret_mtx2 [[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 ret_mtx3 = [[0] * w for _ in range(h)] ret_mtx3 [[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 ret_mtx4 = [[0] * w for _ in range(h)] ret_mtx4 [[0] * w for _ in range(h)] for i in range(h):
    for j in range(w):
        if mtx[i][j] == '.':
            ret_mtx1[i][j] = 1 if i == 0 else ret_mtx1[i-1][j] + 1
            ret_mtx2[i][j] = 1 if j == 0 else ret_mtx2[i][j-1] + 1
        if mtx[-1-i][-1-j] == '.':
            ret_mtx3[-1-i][-1-j] = 1 if i == 0 else ret_mtx3[-i][-1-j] + 1
            ret_mtx4[-1-i][-1-j] = 1 if j == 0 else ret_mtx4[-1-i][-j] + 1 i range(h) range h for j in range(w):
        if mtx[i][j] == '.':
            ret_mtx1[i][j] = 1 if i == 0 else ret_mtx1[i-1][j] + 1
            ret_mtx2[i][j] = 1 if j == 0 else ret_mtx2[i][j-1] + 1
        if mtx[-1-i][-1-j] == '.':
            ret_mtx3[-1-i][-1-j] = 1 if i == 0 else ret_mtx3[-i][-1-j] + 1
            ret_mtx4[-1-i][-1-j] = 1 if j == 0 else ret_mtx4[-1-i][-j] + 1 j range(w) range w if mtx[i][j] == '.':
            ret_mtx1[i][j] = 1 if i == 0 else ret_mtx1[i-1][j] + 1
            ret_mtx2[i][j] = 1 if j == 0 else ret_mtx2[i][j-1] + 1
         mtx[i][j] == '.' mtx[i][j] [i] mtx i j '.' ret_mtx1[i][j] = 1 if i == 0 else ret_mtx1[i-1][j] + 1 ret_mtx1[i][j] [i] ret_mtx1 i j 1 if i == 0 else ret_mtx1[i-1][j] + 1 i == 0 i 0 1 ret_mtx1[i-1][j] + 1 ret_mtx1[i-1][j] [i-1] ret_mtx1 i-1 i 1 j 1 ret_mtx2[i][j] = 1 if j == 0 else ret_mtx2[i][j-1] + 1 ret_mtx2[i][j] [i] ret_mtx2 i j 1 if j == 0 else ret_mtx2[i][j-1] + 1 j == 0 j 0 1 ret_mtx2[i][j-1] + 1 ret_mtx2[i][j-1] [i] ret_mtx2 i j-1 j 1 1 if mtx[-1-i][-1-j] == '.':
            ret_mtx3[-1-i][-1-j] = 1 if i == 0 else ret_mtx3[-i][-1-j] + 1
            ret_mtx4[-1-i][-1-j] = 1 if j == 0 else ret_mtx4[-1-i][-j] + 1 mtx[-1-i][-1-j] == '.' mtx[-1-i][-1-j] [-1-i] mtx -1-i -1 i -1-j -1 j '.' ret_mtx3[-1-i][-1-j] = 1 if i == 0 else ret_mtx3[-i][-1-j] + 1 ret_mtx3[-1-i][-1-j] [-1-i] ret_mtx3 -1-i -1 i -1-j -1 j 1 if i == 0 else ret_mtx3[-i][-1-j] + 1 i == 0 i 0 1 ret_mtx3[-i][-1-j] + 1 ret_mtx3[-i][-1-j] [-i] ret_mtx3 -i i -1-j -1 j 1 ret_mtx4[-1-i][-1-j] = 1 if j == 0 else ret_mtx4[-1-i][-j] + 1 ret_mtx4[-1-i][-1-j] [-1-i] ret_mtx4 -1-i -1 i -1-j -1 j 1 if j == 0 else ret_mtx4[-1-i][-j] + 1 j == 0 j 0 1 ret_mtx4[-1-i][-j] + 1 ret_mtx4[-1-i][-j] [-1-i] ret_mtx4 -1-i -1 i -j j 1 ret = 0 ret 0 for i in range(h):
    for j in range(w):
        tmp = ret_mtx1[i][j] + ret_mtx2[i][j] + \
            ret_mtx3[i][j] + ret_mtx4[i][j] - 3
        ret = max(ret, tmp) i range(h) range h for j in range(w):
        tmp = ret_mtx1[i][j] + ret_mtx2[i][j] + \
            ret_mtx3[i][j] + ret_mtx4[i][j] - 3
        ret = max(ret, tmp) j range(w) range w tmp = ret_mtx1[i][j] + ret_mtx2[i][j] + \
            ret_mtx3[i][j] + ret_mtx4[i][j] - 3 tmp ret_mtx1[i][j] + ret_mtx2[i][j] + \
            ret_mtx3[i][j] + ret_mtx4[i][j] - 3 ret_mtx1[i][j] + ret_mtx2[i][j] + \
            ret_mtx3[i][j] + ret_mtx4[i][j] ret_mtx1[i][j] + ret_mtx2[i][j] + \
            ret_mtx3[i][j] ret_mtx1[i][j] + ret_mtx2[i][j] ret_mtx1[i][j] [i] ret_mtx1 i j ret_mtx2[i][j] [i] ret_mtx2 i j ret_mtx3[i][j] [i] ret_mtx3 i j ret_mtx4[i][j] [i] ret_mtx4 i j 3 ret = max(ret, tmp) ret max(ret, tmp) max ret tmp print(ret) print ret mtx = [input() for _ in range(h)] [input() for _ in range(h)] mtx w = map(int, input().split()) map(int, input().split()) w ret_mtx3 = [[0] * w for _ in range(h)] [[0] * w for _ in range(h)] ret_mtx3 tmp = ret_mtx1[i][j] + ret_mtx2[i][j] + \
            ret_mtx3[i][j] + ret_mtx4[i][j] - 3 ret_mtx1[i][j] + ret_mtx2[i][j] + \
            ret_mtx3[i][j] + ret_mtx4[i][j] - 3 tmp ret = max(ret, tmp) max(ret, tmp) ret ret = 0 0 ret ret_mtx2 = [[0] * w for _ in range(h)] [[0] * w for _ in range(h)] ret_mtx2 h, w = map(int, input().split()) map(int, input().split()) h ret_mtx1 = [[0] * w for _ in range(h)] [[0] * w for _ in range(h)] ret_mtx1 ret_mtx4 = [[0] * w for _ in range(h)] [[0] * w for _ in range(h)] ret_mtx4
h, w = map(int, input().split())

mtx = [input() for _ in range(h)]

ret_mtx1 = [[0] * w for _ in range(h)]
ret_mtx2 = [[0] * w for _ in range(h)]
ret_mtx3 = [[0] * w for _ in range(h)]
ret_mtx4 = [[0] * w for _ in range(h)]

# left 2 right
for i in range(h):
    for j in range(w):
        if mtx[i][j] == '.':
            ret_mtx1[i][j] = 1 if i == 0 else ret_mtx1[i-1][j] + 1
            ret_mtx2[i][j] = 1 if j == 0 else ret_mtx2[i][j-1] + 1
        if mtx[-1-i][-1-j] == '.':
            ret_mtx3[-1-i][-1-j] = 1 if i == 0 else ret_mtx3[-i][-1-j] + 1
            ret_mtx4[-1-i][-1-j] = 1 if j == 0 else ret_mtx4[-1-i][-j] + 1

ret = 0

for i in range(h):
    for j in range(w):
        tmp = ret_mtx1[i][j] + ret_mtx2[i][j] + \
            ret_mtx3[i][j] + ret_mtx4[i][j] - 3
        ret = max(ret, tmp)

print(ret)
