h, w = map(int, input().split())
S = [list(input()) for _ in range(h)]
L = [[0]*w for _ in range(h)]
for i in range(h):
    for j in range(w):
        if j == 0 and S[i][j] != '#':
            L[i][j] = 1
        elif S[i][j] != '#':
            L[i][j] = L[i][j-1] + 1
R = [[0]*w for _ in range(h)]
for i in range(h):
    for j in range(w-1, -1, -1):
        if j == w-1 and S[i][j] != '#':
            R[i][j] = 1
        elif S[i][j] != '#':
            R[i][j] = R[i][j+1] + 1
U = [[0]*w for _ in range(h)]
for j in range(w):
    for i in range(h):
        if i == 0 and S[i][j] != '#':
            U[i][j] = 1
        elif S[i][j] != '#':
            U[i][j] = U[i-1][j] + 1
D = [[0]*w for _ in range(h)]
for j in range(w):
    for i in range(h-1, -1, -1):
        if i == h-1 and S[i][j] != '#':
            D[i][j] = 1
        elif S[i][j] != '#':
            D[i][j] = D[i+1][j] + 1
ans = -1
for i in range(h):
    for j in range(w):
        ans = max(ans, L[i][j]+R[i][j]+U[i][j]+D[i][j]-3)
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 S = [list(input()) for _ in range(h)] S [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 L = [[0]*w for _ in range(h)] L [[0]*w for _ in range(h)] for i in range(h):
    for j in range(w):
        if j == 0 and S[i][j] != '#':
            L[i][j] = 1
        elif S[i][j] != '#':
            L[i][j] = L[i][j-1] + 1 i range(h) range h for j in range(w):
        if j == 0 and S[i][j] != '#':
            L[i][j] = 1
        elif S[i][j] != '#':
            L[i][j] = L[i][j-1] + 1 j range(w) range w if j == 0 and S[i][j] != '#':
            L[i][j] = 1
        elif S[i][j] != '#':
            L[i][j] = L[i][j-1] + 1 j == 0 and S[i][j] != '#' j == 0 j 0 S[i][j] != '#' S[i][j] [i] S i j '#' L[i][j] = 1 L[i][j] [i] L i j 1 elif S[i][j] != '#':
            L[i][j] = L[i][j-1] + 1 S[i][j] != '#' S[i][j] [i] S 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 [0]*w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0]*w [0] 0 w R = [[0]*w for _ in range(h)] R [[0]*w for _ in range(h)] for i in range(h):
    for j in range(w-1, -1, -1):
        if j == w-1 and S[i][j] != '#':
            R[i][j] = 1
        elif S[i][j] != '#':
            R[i][j] = R[i][j+1] + 1 i range(h) range h for j in range(w-1, -1, -1):
        if j == w-1 and S[i][j] != '#':
            R[i][j] = 1
        elif S[i][j] != '#':
            R[i][j] = R[i][j+1] + 1 j range(w-1, -1, -1) range w-1 w 1 -1 -1 if j == w-1 and S[i][j] != '#':
            R[i][j] = 1
        elif S[i][j] != '#':
            R[i][j] = R[i][j+1] + 1 j == w-1 and S[i][j] != '#' j == w-1 j w-1 w 1 S[i][j] != '#' S[i][j] [i] S i j '#' R[i][j] = 1 R[i][j] [i] R i j 1 elif S[i][j] != '#':
            R[i][j] = R[i][j+1] + 1 S[i][j] != '#' S[i][j] [i] S 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 [0]*w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0]*w [0] 0 w U = [[0]*w for _ in range(h)] U [[0]*w for _ in range(h)] for j in range(w):
    for i in range(h):
        if i == 0 and S[i][j] != '#':
            U[i][j] = 1
        elif S[i][j] != '#':
            U[i][j] = U[i-1][j] + 1 j range(w) range w for i in range(h):
        if i == 0 and S[i][j] != '#':
            U[i][j] = 1
        elif S[i][j] != '#':
            U[i][j] = U[i-1][j] + 1 i range(h) range h if i == 0 and S[i][j] != '#':
            U[i][j] = 1
        elif S[i][j] != '#':
            U[i][j] = U[i-1][j] + 1 i == 0 and S[i][j] != '#' i == 0 i 0 S[i][j] != '#' S[i][j] [i] S i j '#' U[i][j] = 1 U[i][j] [i] U i j 1 elif S[i][j] != '#':
            U[i][j] = U[i-1][j] + 1 S[i][j] != '#' S[i][j] [i] S 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 [0]*w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0]*w [0] 0 w D = [[0]*w for _ in range(h)] D [[0]*w for _ in range(h)] for j in range(w):
    for i in range(h-1, -1, -1):
        if i == h-1 and S[i][j] != '#':
            D[i][j] = 1
        elif S[i][j] != '#':
            D[i][j] = D[i+1][j] + 1 j range(w) range w for i in range(h-1, -1, -1):
        if i == h-1 and S[i][j] != '#':
            D[i][j] = 1
        elif S[i][j] != '#':
            D[i][j] = D[i+1][j] + 1 i range(h-1, -1, -1) range h-1 h 1 -1 -1 if i == h-1 and S[i][j] != '#':
            D[i][j] = 1
        elif S[i][j] != '#':
            D[i][j] = D[i+1][j] + 1 i == h-1 and S[i][j] != '#' i == h-1 i h-1 h 1 S[i][j] != '#' S[i][j] [i] S i j '#' D[i][j] = 1 D[i][j] [i] D i j 1 elif S[i][j] != '#':
            D[i][j] = D[i+1][j] + 1 S[i][j] != '#' S[i][j] [i] S 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 ans = -1 ans -1 for i in range(h):
    for j in range(w):
        ans = max(ans, L[i][j]+R[i][j]+U[i][j]+D[i][j]-3) i range(h) range h for j in range(w):
        ans = max(ans, L[i][j]+R[i][j]+U[i][j]+D[i][j]-3) j range(w) range w 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 L = [[0]*w for _ in range(h)] [[0]*w for _ in range(h)] L R = [[0]*w for _ in range(h)] [[0]*w for _ in range(h)] R 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 ans = -1 -1 ans U = [[0]*w for _ in range(h)] [[0]*w for _ in range(h)] U w = map(int, input().split()) map(int, input().split()) w S = [list(input()) for _ in range(h)] [list(input()) for _ in range(h)] S D = [[0]*w for _ in range(h)] [[0]*w for _ in range(h)] D h, w = map(int, input().split()) map(int, input().split()) h
h, w = map(int, input().split())
S = [list(input()) for _ in range(h)]
L = [[0]*w for _ in range(h)]
for i in range(h):
    for j in range(w):
        if j == 0 and S[i][j] != '#':
            L[i][j] = 1
        elif S[i][j] != '#':
            L[i][j] = L[i][j-1] + 1
R = [[0]*w for _ in range(h)]
for i in range(h):
    for j in range(w-1, -1, -1):
        if j == w-1 and S[i][j] != '#':
            R[i][j] = 1
        elif S[i][j] != '#':
            R[i][j] = R[i][j+1] + 1
U = [[0]*w for _ in range(h)]
for j in range(w):
    for i in range(h):
        if i == 0 and S[i][j] != '#':
            U[i][j] = 1
        elif S[i][j] != '#':
            U[i][j] = U[i-1][j] + 1
D = [[0]*w for _ in range(h)]
for j in range(w):
    for i in range(h-1, -1, -1):
        if i == h-1 and S[i][j] != '#':
            D[i][j] = 1
        elif S[i][j] != '#':
            D[i][j] = D[i+1][j] + 1
ans = -1
for i in range(h):
    for j in range(w):
        ans = max(ans, L[i][j]+R[i][j]+U[i][j]+D[i][j]-3)
print(ans)