H, W = map(int,input().split())

S = [input() for _ in range(H)]

a = [[0] * W for _ in range(H)] # 右
b = [[0] * W for _ in range(H)] # 左
c = [[0] * H for _ in range(W)] # 上
d = [[0] * H for _ in range(W)] # 下

for x in range(H):
    for y in range(W):
        if S[x][y] == '#':
            a[x][y] = -1
        elif y > 0:
            a[x][y] = a[x][y-1] + 1
            
for x in range(H):
    for y in range(W-1,-1,-1):
        if S[x][y] == '#':
            b[x][y] = -1
        elif y < W-1:
            b[x][y] = b[x][y+1] + 1

for y in range(W):
    for x in range(H):
        if S[x][y] == '#':
            c[y][x] = -1
        elif x > 0:
            c[y][x] = c[y][x-1] + 1

for y in range(W):
    for x in range(H-1,-1,-1):
        if S[x][y] == '#':
            d[y][x] = -1
        elif x < H-1:
            d[y][x] = d[y][x+1] + 1

ans = 0

for x in range(H):
    for y in range(W):
        if S[x][y] != '#':
            ans = max(ans,a[x][y]+b[x][y]+c[y][x]+d[y][x]+1)

print(ans) 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 S = [input() for _ in range(H)] S [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 a = [[0] * W for _ in range(H)] a [[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 b = [[0] * W for _ in range(H)] b [[0] * W for _ in range(H)] [0] * H for _ in range(W) for _ in range(W) _ range(W) range W for _ in range(W) [0] * H [0] 0 H c = [[0] * H for _ in range(W)] c [[0] * H for _ in range(W)] [0] * H for _ in range(W) for _ in range(W) _ range(W) range W for _ in range(W) [0] * H [0] 0 H d = [[0] * H for _ in range(W)] d [[0] * H for _ in range(W)] for x in range(H):
    for y in range(W):
        if S[x][y] == '#':
            a[x][y] = -1
        elif y > 0:
            a[x][y] = a[x][y-1] + 1
             x range(H) range H for y in range(W):
        if S[x][y] == '#':
            a[x][y] = -1
        elif y > 0:
            a[x][y] = a[x][y-1] + 1
             y range(W) range W if S[x][y] == '#':
            a[x][y] = -1
        elif y > 0:
            a[x][y] = a[x][y-1] + 1
             S[x][y] == '#' S[x][y] [x] S x y '#' a[x][y] = -1 a[x][y] [x] a x y -1 elif y > 0:
            a[x][y] = a[x][y-1] + 1
             y > 0 y 0 a[x][y] = a[x][y-1] + 1 a[x][y] [x] a x y a[x][y-1] + 1 a[x][y-1] [x] a x y-1 y 1 1 for x in range(H):
    for y in range(W-1,-1,-1):
        if S[x][y] == '#':
            b[x][y] = -1
        elif y < W-1:
            b[x][y] = b[x][y+1] + 1 x range(H) range H for y in range(W-1,-1,-1):
        if S[x][y] == '#':
            b[x][y] = -1
        elif y < W-1:
            b[x][y] = b[x][y+1] + 1 y range(W-1,-1,-1) range W-1 W 1 -1 -1 if S[x][y] == '#':
            b[x][y] = -1
        elif y < W-1:
            b[x][y] = b[x][y+1] + 1 S[x][y] == '#' S[x][y] [x] S x y '#' b[x][y] = -1 b[x][y] [x] b x y -1 elif y < W-1:
            b[x][y] = b[x][y+1] + 1 y < W-1 y W-1 W 1 b[x][y] = b[x][y+1] + 1 b[x][y] [x] b x y b[x][y+1] + 1 b[x][y+1] [x] b x y+1 y 1 1 for y in range(W):
    for x in range(H):
        if S[x][y] == '#':
            c[y][x] = -1
        elif x > 0:
            c[y][x] = c[y][x-1] + 1 y range(W) range W for x in range(H):
        if S[x][y] == '#':
            c[y][x] = -1
        elif x > 0:
            c[y][x] = c[y][x-1] + 1 x range(H) range H if S[x][y] == '#':
            c[y][x] = -1
        elif x > 0:
            c[y][x] = c[y][x-1] + 1 S[x][y] == '#' S[x][y] [x] S x y '#' c[y][x] = -1 c[y][x] [y] c y x -1 elif x > 0:
            c[y][x] = c[y][x-1] + 1 x > 0 x 0 c[y][x] = c[y][x-1] + 1 c[y][x] [y] c y x c[y][x-1] + 1 c[y][x-1] [y] c y x-1 x 1 1 for y in range(W):
    for x in range(H-1,-1,-1):
        if S[x][y] == '#':
            d[y][x] = -1
        elif x < H-1:
            d[y][x] = d[y][x+1] + 1 y range(W) range W for x in range(H-1,-1,-1):
        if S[x][y] == '#':
            d[y][x] = -1
        elif x < H-1:
            d[y][x] = d[y][x+1] + 1 x range(H-1,-1,-1) range H-1 H 1 -1 -1 if S[x][y] == '#':
            d[y][x] = -1
        elif x < H-1:
            d[y][x] = d[y][x+1] + 1 S[x][y] == '#' S[x][y] [x] S x y '#' d[y][x] = -1 d[y][x] [y] d y x -1 elif x < H-1:
            d[y][x] = d[y][x+1] + 1 x < H-1 x H-1 H 1 d[y][x] = d[y][x+1] + 1 d[y][x] [y] d y x d[y][x+1] + 1 d[y][x+1] [y] d y x+1 x 1 1 ans = 0 ans 0 for x in range(H):
    for y in range(W):
        if S[x][y] != '#':
            ans = max(ans,a[x][y]+b[x][y]+c[y][x]+d[y][x]+1) x range(H) range H for y in range(W):
        if S[x][y] != '#':
            ans = max(ans,a[x][y]+b[x][y]+c[y][x]+d[y][x]+1) y range(W) range W if S[x][y] != '#':
            ans = max(ans,a[x][y]+b[x][y]+c[y][x]+d[y][x]+1) S[x][y] != '#' S[x][y] [x] S x y '#' ans = max(ans,a[x][y]+b[x][y]+c[y][x]+d[y][x]+1) ans max(ans,a[x][y]+b[x][y]+c[y][x]+d[y][x]+1) max ans a[x][y]+b[x][y]+c[y][x]+d[y][x]+1 a[x][y]+b[x][y]+c[y][x]+d[y][x] a[x][y]+b[x][y]+c[y][x] a[x][y]+b[x][y] a[x][y] [x] a x y b[x][y] [x] b x y c[y][x] [y] c y x d[y][x] [y] d y x 1 print(ans) print ans S = [input() for _ in range(H)] [input() for _ in range(H)] S W = map(int,input().split()) map(int,input().split()) W d = [[0] * H for _ in range(W)] [[0] * H for _ in range(W)] d ans = 0 0 ans ans = max(ans,a[x][y]+b[x][y]+c[y][x]+d[y][x]+1) max(ans,a[x][y]+b[x][y]+c[y][x]+d[y][x]+1) ans c = [[0] * H for _ in range(W)] [[0] * H for _ in range(W)] c H, W = map(int,input().split()) map(int,input().split()) H a = [[0] * W for _ in range(H)] [[0] * W for _ in range(H)] a b = [[0] * W for _ in range(H)] [[0] * W for _ in range(H)] b
H, W = map(int,input().split())

S = [input() for _ in range(H)]

a = [[0] * W for _ in range(H)] # 右
b = [[0] * W for _ in range(H)] # 左
c = [[0] * H for _ in range(W)] # 上
d = [[0] * H for _ in range(W)] # 下

for x in range(H):
    for y in range(W):
        if S[x][y] == '#':
            a[x][y] = -1
        elif y > 0:
            a[x][y] = a[x][y-1] + 1
            
for x in range(H):
    for y in range(W-1,-1,-1):
        if S[x][y] == '#':
            b[x][y] = -1
        elif y < W-1:
            b[x][y] = b[x][y+1] + 1

for y in range(W):
    for x in range(H):
        if S[x][y] == '#':
            c[y][x] = -1
        elif x > 0:
            c[y][x] = c[y][x-1] + 1

for y in range(W):
    for x in range(H-1,-1,-1):
        if S[x][y] == '#':
            d[y][x] = -1
        elif x < H-1:
            d[y][x] = d[y][x+1] + 1

ans = 0

for x in range(H):
    for y in range(W):
        if S[x][y] != '#':
            ans = max(ans,a[x][y]+b[x][y]+c[y][x]+d[y][x]+1)

print(ans)