H, W = map(int,input().split())
S = []
for _ in range(H):
    S.append(input())


yoko, tate = [], []
for h in range(H):
    now = []
    
    w, cnt = 0, 0
    while True:
        if not w < W:
            for _ in range(cnt): now.append(cnt) 
            break

        if S[h][w] == "#":
            for _ in range(cnt): now.append(cnt)
            now.append(0)
            cnt = 0
        else:
            cnt += 1

        w += 1

    yoko.append(now)

for w in range(W):
    now = []
    
    h, cnt = 0, 0
    while True:
        if not h < H:
            for _ in range(cnt): now.append(cnt) 
            break

        if S[h][w] == "#":
            for _ in range(cnt): now.append(cnt)
            now.append(0)
            cnt = 0
        else:
            cnt += 1

        h += 1
    
    tate.append(now)

ans = 0
for h in range(H):
    for w in range(W):
        ans = max(ans, yoko[h][w]+tate[w][h]-1)
    
print(ans) H, W = map(int,input().split()) H map(int,input().split()) map int input().split() ().split () input split W S = [] S [] for _ in range(H):
    S.append(input()) _ range(H) range H S.append(input()) S.append S append input() input yoko, tate = [], [] yoko [] tate [] for h in range(H):
    now = []
    
    w, cnt = 0, 0
    while True:
        if not w < W:
            for _ in range(cnt): now.append(cnt) 
            break

        if S[h][w] == "#":
            for _ in range(cnt): now.append(cnt)
            now.append(0)
            cnt = 0
        else:
            cnt += 1

        w += 1

    yoko.append(now) h range(H) range H now = [] now [] w, cnt = 0, 0 w 0 cnt 0 while True:
        if not w < W:
            for _ in range(cnt): now.append(cnt) 
            break

        if S[h][w] == "#":
            for _ in range(cnt): now.append(cnt)
            now.append(0)
            cnt = 0
        else:
            cnt += 1

        w += 1

     True if not w < W:
            for _ in range(cnt): now.append(cnt) 
            break

         not w < W w < W w W for _ in range(cnt): now.append(cnt) 
             _ range(cnt) range cnt break if S[h][w] == "#":
            for _ in range(cnt): now.append(cnt)
            now.append(0)
            cnt = 0
        else:
            cnt += 1

         S[h][w] == "#" S[h][w] [h] S h w "#" for _ in range(cnt): now.append(cnt)
             _ range(cnt) range cnt now.append(0) now.append now append 0 cnt = 0 cnt 0 cnt += 1 cnt 1 w += 1 w 1 yoko.append(now) yoko.append yoko append now for w in range(W):
    now = []
    
    h, cnt = 0, 0
    while True:
        if not h < H:
            for _ in range(cnt): now.append(cnt) 
            break

        if S[h][w] == "#":
            for _ in range(cnt): now.append(cnt)
            now.append(0)
            cnt = 0
        else:
            cnt += 1

        h += 1
    
    tate.append(now) w range(W) range W now = [] now [] h, cnt = 0, 0 h 0 cnt 0 while True:
        if not h < H:
            for _ in range(cnt): now.append(cnt) 
            break

        if S[h][w] == "#":
            for _ in range(cnt): now.append(cnt)
            now.append(0)
            cnt = 0
        else:
            cnt += 1

        h += 1
    
     True if not h < H:
            for _ in range(cnt): now.append(cnt) 
            break

         not h < H h < H h H for _ in range(cnt): now.append(cnt) 
             _ range(cnt) range cnt break if S[h][w] == "#":
            for _ in range(cnt): now.append(cnt)
            now.append(0)
            cnt = 0
        else:
            cnt += 1

         S[h][w] == "#" S[h][w] [h] S h w "#" for _ in range(cnt): now.append(cnt)
             _ range(cnt) range cnt now.append(0) now.append now append 0 cnt = 0 cnt 0 cnt += 1 cnt 1 h += 1 h 1 tate.append(now) tate.append tate append now ans = 0 ans 0 for h in range(H):
    for w in range(W):
        ans = max(ans, yoko[h][w]+tate[w][h]-1)
     h range(H) range H for w in range(W):
        ans = max(ans, yoko[h][w]+tate[w][h]-1)
     w range(W) range W ans = max(ans, yoko[h][w]+tate[w][h]-1) ans max(ans, yoko[h][w]+tate[w][h]-1) max ans yoko[h][w]+tate[w][h]-1 yoko[h][w]+tate[w][h] yoko[h][w] [h] yoko h w tate[w][h] [w] tate w h 1 print(ans) print ans cnt = 0, 0 0 cnt cnt += 1 1 cnt yoko, tate = [], [] [] yoko ans = 0 0 ans now = [] [] now ans = max(ans, yoko[h][w]+tate[w][h]-1) max(ans, yoko[h][w]+tate[w][h]-1) ans cnt += 1 1 cnt H, W = map(int,input().split()) map(int,input().split()) H S = [] [] S w, cnt = 0, 0 0 w cnt = 0 0 cnt cnt = 0 0 cnt W = map(int,input().split()) map(int,input().split()) W tate = [], [] [] tate w += 1 1 w h, cnt = 0, 0 0 h h += 1 1 h now = [] [] now cnt = 0, 0 0 cnt
H, W = map(int,input().split())
S = []
for _ in range(H):
    S.append(input())


yoko, tate = [], []
for h in range(H):
    now = []
    
    w, cnt = 0, 0
    while True:
        if not w < W:
            for _ in range(cnt): now.append(cnt) 
            break

        if S[h][w] == "#":
            for _ in range(cnt): now.append(cnt)
            now.append(0)
            cnt = 0
        else:
            cnt += 1

        w += 1

    yoko.append(now)

for w in range(W):
    now = []
    
    h, cnt = 0, 0
    while True:
        if not h < H:
            for _ in range(cnt): now.append(cnt) 
            break

        if S[h][w] == "#":
            for _ in range(cnt): now.append(cnt)
            now.append(0)
            cnt = 0
        else:
            cnt += 1

        h += 1
    
    tate.append(now)

ans = 0
for h in range(H):
    for w in range(W):
        ans = max(ans, yoko[h][w]+tate[w][h]-1)
    
print(ans)