r, c = map(int, input().split())
ans = 0

map = []
for i in range(r):
    map.append(input())

L = [[0]*c for i in range(r)]
R = [[0]*c for i in range(r)]
D = [[0]*c for i in range(r)]
U = [[0]*c for i in range(r)]

for i in range(r):
    for j in range(c):
        if map[i][j] == ".":
            L[i][j] = L[i][j - 1] + 1
        else:
            L[i][j] = 0
for i in range(r):
    for j in range(c - 1, -1, -1):
        if j == c - 1:
            if map[i][j] == ".":
                R[i][j] = 1
            continue
        if map[i][j] == ".":
            R[i][j] = R[i][j + 1] + 1
        else:
            R[i][j] = 0
for i in range(r):
    for j in range(c):
        if map[i][j] == ".":
            D[i][j] = D[i - 1][j] + 1
        else:
            D[i][j] = 0
for i in range(r - 1, -1, -1):
    for j in range(c):
        if i == r - 1:
            if map[i][j] == ".":
                U[i][j] = 1
            continue
        if map[i][j] == ".":
            U[i][j] = U[i + 1][j] + 1
        else:
            U[i][j] = 0

for i in range(r):
    for j in range(c):
        ans = max(ans, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3)

print(ans) r, c = map(int, input().split()) r map(int, input().split()) map int input().split() ().split () input split c ans = 0 ans 0 map = [] map [] for i in range(r):
    map.append(input()) i range(r) range r map.append(input()) map.append map append input() input [0]*c for i in range(r) for i in range(r) i range(r) range r for i in range(r) [0]*c [0] 0 c L = [[0]*c for i in range(r)] L [[0]*c for i in range(r)] [0]*c for i in range(r) for i in range(r) i range(r) range r for i in range(r) [0]*c [0] 0 c R = [[0]*c for i in range(r)] R [[0]*c for i in range(r)] [0]*c for i in range(r) for i in range(r) i range(r) range r for i in range(r) [0]*c [0] 0 c D = [[0]*c for i in range(r)] D [[0]*c for i in range(r)] [0]*c for i in range(r) for i in range(r) i range(r) range r for i in range(r) [0]*c [0] 0 c U = [[0]*c for i in range(r)] U [[0]*c for i in range(r)] for i in range(r):
    for j in range(c):
        if map[i][j] == ".":
            L[i][j] = L[i][j - 1] + 1
        else:
            L[i][j] = 0 i range(r) range r for j in range(c):
        if map[i][j] == ".":
            L[i][j] = L[i][j - 1] + 1
        else:
            L[i][j] = 0 j range(c) range c if map[i][j] == ".":
            L[i][j] = L[i][j - 1] + 1
        else:
            L[i][j] = 0 map[i][j] == "." map[i][j] [i] map i j "." L[i][j] = L[i][j - 1] + 1 L[i][j] [i] L i j L[i][j - 1] + 1 L[i][j - 1] [i] L i j - 1 j 1 1 L[i][j] = 0 L[i][j] [i] L i j 0 for i in range(r):
    for j in range(c - 1, -1, -1):
        if j == c - 1:
            if map[i][j] == ".":
                R[i][j] = 1
            continue
        if map[i][j] == ".":
            R[i][j] = R[i][j + 1] + 1
        else:
            R[i][j] = 0 i range(r) range r for j in range(c - 1, -1, -1):
        if j == c - 1:
            if map[i][j] == ".":
                R[i][j] = 1
            continue
        if map[i][j] == ".":
            R[i][j] = R[i][j + 1] + 1
        else:
            R[i][j] = 0 j range(c - 1, -1, -1) range c - 1 c 1 -1 -1 if j == c - 1:
            if map[i][j] == ".":
                R[i][j] = 1
            continue
         j == c - 1 j c - 1 c 1 if map[i][j] == ".":
                R[i][j] = 1
             map[i][j] == "." map[i][j] [i] map i j "." R[i][j] = 1 R[i][j] [i] R i j 1 continue if map[i][j] == ".":
            R[i][j] = R[i][j + 1] + 1
        else:
            R[i][j] = 0 map[i][j] == "." map[i][j] [i] map i j "." R[i][j] = R[i][j + 1] + 1 R[i][j] [i] R i j R[i][j + 1] + 1 R[i][j + 1] [i] R i j + 1 j 1 1 R[i][j] = 0 R[i][j] [i] R i j 0 for i in range(r):
    for j in range(c):
        if map[i][j] == ".":
            D[i][j] = D[i - 1][j] + 1
        else:
            D[i][j] = 0 i range(r) range r for j in range(c):
        if map[i][j] == ".":
            D[i][j] = D[i - 1][j] + 1
        else:
            D[i][j] = 0 j range(c) range c if map[i][j] == ".":
            D[i][j] = D[i - 1][j] + 1
        else:
            D[i][j] = 0 map[i][j] == "." map[i][j] [i] map i j "." D[i][j] = D[i - 1][j] + 1 D[i][j] [i] D i j D[i - 1][j] + 1 D[i - 1][j] [i - 1] D i - 1 i 1 j 1 D[i][j] = 0 D[i][j] [i] D i j 0 for i in range(r - 1, -1, -1):
    for j in range(c):
        if i == r - 1:
            if map[i][j] == ".":
                U[i][j] = 1
            continue
        if map[i][j] == ".":
            U[i][j] = U[i + 1][j] + 1
        else:
            U[i][j] = 0 i range(r - 1, -1, -1) range r - 1 r 1 -1 -1 for j in range(c):
        if i == r - 1:
            if map[i][j] == ".":
                U[i][j] = 1
            continue
        if map[i][j] == ".":
            U[i][j] = U[i + 1][j] + 1
        else:
            U[i][j] = 0 j range(c) range c if i == r - 1:
            if map[i][j] == ".":
                U[i][j] = 1
            continue
         i == r - 1 i r - 1 r 1 if map[i][j] == ".":
                U[i][j] = 1
             map[i][j] == "." map[i][j] [i] map i j "." U[i][j] = 1 U[i][j] [i] U i j 1 continue if map[i][j] == ".":
            U[i][j] = U[i + 1][j] + 1
        else:
            U[i][j] = 0 map[i][j] == "." map[i][j] [i] map i j "." U[i][j] = U[i + 1][j] + 1 U[i][j] [i] U i j U[i + 1][j] + 1 U[i + 1][j] [i + 1] U i + 1 i 1 j 1 U[i][j] = 0 U[i][j] [i] U i j 0 for i in range(r):
    for j in range(c):
        ans = max(ans, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3) i range(r) range r for j in range(c):
        ans = max(ans, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3) j range(c) range c ans = max(ans, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3) ans max(ans, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3) max ans L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3 L[i][j] + R[i][j] + U[i][j] + D[i][j] L[i][j] + R[i][j] + U[i][j] L[i][j] + R[i][j] L[i][j] [i] L i j R[i][j] [i] R i j U[i][j] [i] U i j D[i][j] [i] D i j 3 print(ans) print ans U = [[0]*c for i in range(r)] [[0]*c for i in range(r)] U map = [] [] map ans = max(ans, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3) max(ans, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3) ans D = [[0]*c for i in range(r)] [[0]*c for i in range(r)] D R = [[0]*c for i in range(r)] [[0]*c for i in range(r)] R ans = 0 0 ans c = map(int, input().split()) map(int, input().split()) c L = [[0]*c for i in range(r)] [[0]*c for i in range(r)] L r, c = map(int, input().split()) map(int, input().split()) r
r, c = map(int, input().split())
ans = 0

map = []
for i in range(r):
    map.append(input())

L = [[0]*c for i in range(r)]
R = [[0]*c for i in range(r)]
D = [[0]*c for i in range(r)]
U = [[0]*c for i in range(r)]

for i in range(r):
    for j in range(c):
        if map[i][j] == ".":
            L[i][j] = L[i][j - 1] + 1
        else:
            L[i][j] = 0
for i in range(r):
    for j in range(c - 1, -1, -1):
        if j == c - 1:
            if map[i][j] == ".":
                R[i][j] = 1
            continue
        if map[i][j] == ".":
            R[i][j] = R[i][j + 1] + 1
        else:
            R[i][j] = 0
for i in range(r):
    for j in range(c):
        if map[i][j] == ".":
            D[i][j] = D[i - 1][j] + 1
        else:
            D[i][j] = 0
for i in range(r - 1, -1, -1):
    for j in range(c):
        if i == r - 1:
            if map[i][j] == ".":
                U[i][j] = 1
            continue
        if map[i][j] == ".":
            U[i][j] = U[i + 1][j] + 1
        else:
            U[i][j] = 0

for i in range(r):
    for j in range(c):
        ans = max(ans, L[i][j] + R[i][j] + U[i][j] + D[i][j] - 3)

print(ans)