H, W = map(int, input().split())
S = [0]*(H+2)
S[0] = '*'*(W+2)
S[H+1] = '*'*(W+2)
for h in range(1,H+1):
    S[h] = '*' + input() + '*'

left = [[0]*(W+1) for _ in range(H+1)]
right = [[0]*(W+1) for _ in range(H+1)]
up = [[0]*(W+1) for _ in range(H+1)]
down = [[0]*(W+1) for _ in range(H+1)]

for h in range(1,H+1):
    for w in range(1,W+1):
        if S[h][w-1] in ['#','*'] or S[h][w]=='#':
            left[h][w] = 0
        else:
            left[h][w] = left[h][w-1]+1

for h in range(1,H+1):
    for w in range(W,0,-1):
        if S[h][w+1] in ['#','*'] or S[h][w]=='#':
            right[h][w] = 0
        else:
            right[h][w] = right[h][w+1]+1

for w in range(1,W+1):
    for h in range(1,H+1):
        if S[h-1][w] in ['#','*'] or S[h][w]=='#':
            up[h][w] = 0
        else:
            up[h][w] = up[h-1][w]+1

for w in range(1,W+1):
    for h in range(H,0,-1):
        if S[h+1][w] in ['#','*'] or S[h][w]=='#':
            down[h][w] = 0
        else:
            down[h][w] = down[h+1][w]+1
ans = 0
for h in range(1,H+1):
    for w in range(1,W+1):
        ans = max(ans,left[h][w]+right[h][w]+up[h][w]+down[h][w]+1)

print(ans) H, W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W S = [0]*(H+2) S [0]*(H+2) [0] 0 H+2 H 2 S[0] = '*'*(W+2) S[0] S 0 '*'*(W+2) '*' W+2 W 2 S[H+1] = '*'*(W+2) S[H+1] S H+1 H 1 '*'*(W+2) '*' W+2 W 2 for h in range(1,H+1):
    S[h] = '*' + input() + '*' h range(1,H+1) range 1 H+1 H 1 S[h] = '*' + input() + '*' S[h] S h '*' + input() + '*' '*' + input() '*' input() input '*' [0]*(W+1) for _ in range(H+1) for _ in range(H+1) _ range(H+1) range H+1 H 1 for _ in range(H+1) [0]*(W+1) [0] 0 W+1 W 1 left = [[0]*(W+1) for _ in range(H+1)] left [[0]*(W+1) for _ in range(H+1)] [0]*(W+1) for _ in range(H+1) for _ in range(H+1) _ range(H+1) range H+1 H 1 for _ in range(H+1) [0]*(W+1) [0] 0 W+1 W 1 right = [[0]*(W+1) for _ in range(H+1)] right [[0]*(W+1) for _ in range(H+1)] [0]*(W+1) for _ in range(H+1) for _ in range(H+1) _ range(H+1) range H+1 H 1 for _ in range(H+1) [0]*(W+1) [0] 0 W+1 W 1 up = [[0]*(W+1) for _ in range(H+1)] up [[0]*(W+1) for _ in range(H+1)] [0]*(W+1) for _ in range(H+1) for _ in range(H+1) _ range(H+1) range H+1 H 1 for _ in range(H+1) [0]*(W+1) [0] 0 W+1 W 1 down = [[0]*(W+1) for _ in range(H+1)] down [[0]*(W+1) for _ in range(H+1)] for h in range(1,H+1):
    for w in range(1,W+1):
        if S[h][w-1] in ['#','*'] or S[h][w]=='#':
            left[h][w] = 0
        else:
            left[h][w] = left[h][w-1]+1 h range(1,H+1) range 1 H+1 H 1 for w in range(1,W+1):
        if S[h][w-1] in ['#','*'] or S[h][w]=='#':
            left[h][w] = 0
        else:
            left[h][w] = left[h][w-1]+1 w range(1,W+1) range 1 W+1 W 1 if S[h][w-1] in ['#','*'] or S[h][w]=='#':
            left[h][w] = 0
        else:
            left[h][w] = left[h][w-1]+1 S[h][w-1] in ['#','*'] or S[h][w]=='#' S[h][w-1] in ['#','*'] S[h][w-1] [h] S h w-1 w 1 ['#','*'] '#' '*' S[h][w]=='#' S[h][w] [h] S h w '#' left[h][w] = 0 left[h][w] [h] left h w 0 left[h][w] = left[h][w-1]+1 left[h][w] [h] left h w left[h][w-1]+1 left[h][w-1] [h] left h w-1 w 1 1 for h in range(1,H+1):
    for w in range(W,0,-1):
        if S[h][w+1] in ['#','*'] or S[h][w]=='#':
            right[h][w] = 0
        else:
            right[h][w] = right[h][w+1]+1 h range(1,H+1) range 1 H+1 H 1 for w in range(W,0,-1):
        if S[h][w+1] in ['#','*'] or S[h][w]=='#':
            right[h][w] = 0
        else:
            right[h][w] = right[h][w+1]+1 w range(W,0,-1) range W 0 -1 if S[h][w+1] in ['#','*'] or S[h][w]=='#':
            right[h][w] = 0
        else:
            right[h][w] = right[h][w+1]+1 S[h][w+1] in ['#','*'] or S[h][w]=='#' S[h][w+1] in ['#','*'] S[h][w+1] [h] S h w+1 w 1 ['#','*'] '#' '*' S[h][w]=='#' S[h][w] [h] S h w '#' right[h][w] = 0 right[h][w] [h] right h w 0 right[h][w] = right[h][w+1]+1 right[h][w] [h] right h w right[h][w+1]+1 right[h][w+1] [h] right h w+1 w 1 1 for w in range(1,W+1):
    for h in range(1,H+1):
        if S[h-1][w] in ['#','*'] or S[h][w]=='#':
            up[h][w] = 0
        else:
            up[h][w] = up[h-1][w]+1 w range(1,W+1) range 1 W+1 W 1 for h in range(1,H+1):
        if S[h-1][w] in ['#','*'] or S[h][w]=='#':
            up[h][w] = 0
        else:
            up[h][w] = up[h-1][w]+1 h range(1,H+1) range 1 H+1 H 1 if S[h-1][w] in ['#','*'] or S[h][w]=='#':
            up[h][w] = 0
        else:
            up[h][w] = up[h-1][w]+1 S[h-1][w] in ['#','*'] or S[h][w]=='#' S[h-1][w] in ['#','*'] S[h-1][w] [h-1] S h-1 h 1 w ['#','*'] '#' '*' S[h][w]=='#' S[h][w] [h] S h w '#' up[h][w] = 0 up[h][w] [h] up h w 0 up[h][w] = up[h-1][w]+1 up[h][w] [h] up h w up[h-1][w]+1 up[h-1][w] [h-1] up h-1 h 1 w 1 for w in range(1,W+1):
    for h in range(H,0,-1):
        if S[h+1][w] in ['#','*'] or S[h][w]=='#':
            down[h][w] = 0
        else:
            down[h][w] = down[h+1][w]+1 w range(1,W+1) range 1 W+1 W 1 for h in range(H,0,-1):
        if S[h+1][w] in ['#','*'] or S[h][w]=='#':
            down[h][w] = 0
        else:
            down[h][w] = down[h+1][w]+1 h range(H,0,-1) range H 0 -1 if S[h+1][w] in ['#','*'] or S[h][w]=='#':
            down[h][w] = 0
        else:
            down[h][w] = down[h+1][w]+1 S[h+1][w] in ['#','*'] or S[h][w]=='#' S[h+1][w] in ['#','*'] S[h+1][w] [h+1] S h+1 h 1 w ['#','*'] '#' '*' S[h][w]=='#' S[h][w] [h] S h w '#' down[h][w] = 0 down[h][w] [h] down h w 0 down[h][w] = down[h+1][w]+1 down[h][w] [h] down h w down[h+1][w]+1 down[h+1][w] [h+1] down h+1 h 1 w 1 ans = 0 ans 0 for h in range(1,H+1):
    for w in range(1,W+1):
        ans = max(ans,left[h][w]+right[h][w]+up[h][w]+down[h][w]+1) h range(1,H+1) range 1 H+1 H 1 for w in range(1,W+1):
        ans = max(ans,left[h][w]+right[h][w]+up[h][w]+down[h][w]+1) w range(1,W+1) range 1 W+1 W 1 ans = max(ans,left[h][w]+right[h][w]+up[h][w]+down[h][w]+1) ans max(ans,left[h][w]+right[h][w]+up[h][w]+down[h][w]+1) max ans left[h][w]+right[h][w]+up[h][w]+down[h][w]+1 left[h][w]+right[h][w]+up[h][w]+down[h][w] left[h][w]+right[h][w]+up[h][w] left[h][w]+right[h][w] left[h][w] [h] left h w right[h][w] [h] right h w up[h][w] [h] up h w down[h][w] [h] down h w 1 print(ans) print ans ans = 0 0 ans S = [0]*(H+2) [0]*(H+2) S down = [[0]*(W+1) for _ in range(H+1)] [[0]*(W+1) for _ in range(H+1)] down H, W = map(int, input().split()) map(int, input().split()) H ans = max(ans,left[h][w]+right[h][w]+up[h][w]+down[h][w]+1) max(ans,left[h][w]+right[h][w]+up[h][w]+down[h][w]+1) ans W = map(int, input().split()) map(int, input().split()) W left = [[0]*(W+1) for _ in range(H+1)] [[0]*(W+1) for _ in range(H+1)] left right = [[0]*(W+1) for _ in range(H+1)] [[0]*(W+1) for _ in range(H+1)] right up = [[0]*(W+1) for _ in range(H+1)] [[0]*(W+1) for _ in range(H+1)] up
H, W = map(int, input().split())
S = [0]*(H+2)
S[0] = '*'*(W+2)
S[H+1] = '*'*(W+2)
for h in range(1,H+1):
    S[h] = '*' + input() + '*'

left = [[0]*(W+1) for _ in range(H+1)]
right = [[0]*(W+1) for _ in range(H+1)]
up = [[0]*(W+1) for _ in range(H+1)]
down = [[0]*(W+1) for _ in range(H+1)]

for h in range(1,H+1):
    for w in range(1,W+1):
        if S[h][w-1] in ['#','*'] or S[h][w]=='#':
            left[h][w] = 0
        else:
            left[h][w] = left[h][w-1]+1

for h in range(1,H+1):
    for w in range(W,0,-1):
        if S[h][w+1] in ['#','*'] or S[h][w]=='#':
            right[h][w] = 0
        else:
            right[h][w] = right[h][w+1]+1

for w in range(1,W+1):
    for h in range(1,H+1):
        if S[h-1][w] in ['#','*'] or S[h][w]=='#':
            up[h][w] = 0
        else:
            up[h][w] = up[h-1][w]+1

for w in range(1,W+1):
    for h in range(H,0,-1):
        if S[h+1][w] in ['#','*'] or S[h][w]=='#':
            down[h][w] = 0
        else:
            down[h][w] = down[h+1][w]+1
ans = 0
for h in range(1,H+1):
    for w in range(1,W+1):
        ans = max(ans,left[h][w]+right[h][w]+up[h][w]+down[h][w]+1)

print(ans)