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

grid = []

for i in range(H):
    s = input()
    r = []
    for j, x in enumerate(s):
        r.append(x)

    grid.append(r)


H_cnt = [[0] * W for _ in range(H)]
W_cnt = [[0] * W for _ in range(H)]

for r in range(H):
    idx = 0

    while idx < W:
        if grid[r][idx] == '.' and (idx == 0 or grid[r][idx - 1] == '#'):
            cnt = 1
            st = idx
            if idx == W - 1 or grid[r][idx + 1] == '#':
                W_cnt[r][idx] = 1
        elif grid[r][idx] == '.' and (idx == W - 1 or grid[r][idx + 1] == '#'):
            cnt += 1
            for i in range(st, idx + 1):
                W_cnt[r][i] = cnt
        elif grid[r][idx] == '.':
            cnt += 1
        elif grid[r][idx] == '#':
            pass

        idx += 1

for c in range(W):
    idx = 0

    while idx < H:
        if grid[idx][c] == '.' and (idx == 0 or grid[idx - 1][c] == '#'):
            cnt = 1
            st = idx
            if idx == H - 1 or grid[idx + 1][c] == '#':
                H_cnt[idx][c] = 1
        elif grid[idx][c] == '.' and (idx == H - 1 or grid[idx + 1][c] == '#'):
            cnt += 1
            for i in range(st, idx + 1):
                H_cnt[i][c] = cnt
        elif grid[idx][c] == '.':
            cnt += 1
        elif grid[idx][c] == '#':
            pass

        idx += 1

max_ = 0
for r in range(H):
    for c in range(W):
        max_ = max(max_, W_cnt[r][c] + H_cnt[r][c] - 1)

print(max_) H, W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W grid = [] grid [] for i in range(H):
    s = input()
    r = []
    for j, x in enumerate(s):
        r.append(x)

    grid.append(r) i range(H) range H s = input() s input() input r = [] r [] for j, x in enumerate(s):
        r.append(x)

     j x enumerate(s) enumerate s r.append(x) r.append r append x grid.append(r) grid.append grid append r [0] * W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0] * W [0] 0 W H_cnt = [[0] * W for _ in range(H)] H_cnt [[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 W_cnt = [[0] * W for _ in range(H)] W_cnt [[0] * W for _ in range(H)] for r in range(H):
    idx = 0

    while idx < W:
        if grid[r][idx] == '.' and (idx == 0 or grid[r][idx - 1] == '#'):
            cnt = 1
            st = idx
            if idx == W - 1 or grid[r][idx + 1] == '#':
                W_cnt[r][idx] = 1
        elif grid[r][idx] == '.' and (idx == W - 1 or grid[r][idx + 1] == '#'):
            cnt += 1
            for i in range(st, idx + 1):
                W_cnt[r][i] = cnt
        elif grid[r][idx] == '.':
            cnt += 1
        elif grid[r][idx] == '#':
            pass

        idx += 1 r range(H) range H idx = 0 idx 0 while idx < W:
        if grid[r][idx] == '.' and (idx == 0 or grid[r][idx - 1] == '#'):
            cnt = 1
            st = idx
            if idx == W - 1 or grid[r][idx + 1] == '#':
                W_cnt[r][idx] = 1
        elif grid[r][idx] == '.' and (idx == W - 1 or grid[r][idx + 1] == '#'):
            cnt += 1
            for i in range(st, idx + 1):
                W_cnt[r][i] = cnt
        elif grid[r][idx] == '.':
            cnt += 1
        elif grid[r][idx] == '#':
            pass

        idx += 1 idx < W idx W if grid[r][idx] == '.' and (idx == 0 or grid[r][idx - 1] == '#'):
            cnt = 1
            st = idx
            if idx == W - 1 or grid[r][idx + 1] == '#':
                W_cnt[r][idx] = 1
        elif grid[r][idx] == '.' and (idx == W - 1 or grid[r][idx + 1] == '#'):
            cnt += 1
            for i in range(st, idx + 1):
                W_cnt[r][i] = cnt
        elif grid[r][idx] == '.':
            cnt += 1
        elif grid[r][idx] == '#':
            pass

         grid[r][idx] == '.' and (idx == 0 or grid[r][idx - 1] == '#') grid[r][idx] == '.' grid[r][idx] [r] grid r idx '.' idx == 0 or grid[r][idx - 1] == '#' idx == 0 idx 0 grid[r][idx - 1] == '#' grid[r][idx - 1] [r] grid r idx - 1 idx 1 '#' cnt = 1 cnt 1 st = idx st idx if idx == W - 1 or grid[r][idx + 1] == '#':
                W_cnt[r][idx] = 1
         idx == W - 1 or grid[r][idx + 1] == '#' idx == W - 1 idx W - 1 W 1 grid[r][idx + 1] == '#' grid[r][idx + 1] [r] grid r idx + 1 idx 1 '#' W_cnt[r][idx] = 1 W_cnt[r][idx] [r] W_cnt r idx 1 elif grid[r][idx] == '.' and (idx == W - 1 or grid[r][idx + 1] == '#'):
            cnt += 1
            for i in range(st, idx + 1):
                W_cnt[r][i] = cnt
         grid[r][idx] == '.' and (idx == W - 1 or grid[r][idx + 1] == '#') grid[r][idx] == '.' grid[r][idx] [r] grid r idx '.' idx == W - 1 or grid[r][idx + 1] == '#' idx == W - 1 idx W - 1 W 1 grid[r][idx + 1] == '#' grid[r][idx + 1] [r] grid r idx + 1 idx 1 '#' cnt += 1 cnt 1 for i in range(st, idx + 1):
                W_cnt[r][i] = cnt
         i range(st, idx + 1) range st idx + 1 idx 1 W_cnt[r][i] = cnt W_cnt[r][i] [r] W_cnt r i cnt elif grid[r][idx] == '.':
            cnt += 1
         grid[r][idx] == '.' grid[r][idx] [r] grid r idx '.' cnt += 1 cnt 1 elif grid[r][idx] == '#':
            pass

         grid[r][idx] == '#' grid[r][idx] [r] grid r idx '#' idx += 1 idx 1 for c in range(W):
    idx = 0

    while idx < H:
        if grid[idx][c] == '.' and (idx == 0 or grid[idx - 1][c] == '#'):
            cnt = 1
            st = idx
            if idx == H - 1 or grid[idx + 1][c] == '#':
                H_cnt[idx][c] = 1
        elif grid[idx][c] == '.' and (idx == H - 1 or grid[idx + 1][c] == '#'):
            cnt += 1
            for i in range(st, idx + 1):
                H_cnt[i][c] = cnt
        elif grid[idx][c] == '.':
            cnt += 1
        elif grid[idx][c] == '#':
            pass

        idx += 1 c range(W) range W idx = 0 idx 0 while idx < H:
        if grid[idx][c] == '.' and (idx == 0 or grid[idx - 1][c] == '#'):
            cnt = 1
            st = idx
            if idx == H - 1 or grid[idx + 1][c] == '#':
                H_cnt[idx][c] = 1
        elif grid[idx][c] == '.' and (idx == H - 1 or grid[idx + 1][c] == '#'):
            cnt += 1
            for i in range(st, idx + 1):
                H_cnt[i][c] = cnt
        elif grid[idx][c] == '.':
            cnt += 1
        elif grid[idx][c] == '#':
            pass

        idx += 1 idx < H idx H if grid[idx][c] == '.' and (idx == 0 or grid[idx - 1][c] == '#'):
            cnt = 1
            st = idx
            if idx == H - 1 or grid[idx + 1][c] == '#':
                H_cnt[idx][c] = 1
        elif grid[idx][c] == '.' and (idx == H - 1 or grid[idx + 1][c] == '#'):
            cnt += 1
            for i in range(st, idx + 1):
                H_cnt[i][c] = cnt
        elif grid[idx][c] == '.':
            cnt += 1
        elif grid[idx][c] == '#':
            pass

         grid[idx][c] == '.' and (idx == 0 or grid[idx - 1][c] == '#') grid[idx][c] == '.' grid[idx][c] [idx] grid idx c '.' idx == 0 or grid[idx - 1][c] == '#' idx == 0 idx 0 grid[idx - 1][c] == '#' grid[idx - 1][c] [idx - 1] grid idx - 1 idx 1 c '#' cnt = 1 cnt 1 st = idx st idx if idx == H - 1 or grid[idx + 1][c] == '#':
                H_cnt[idx][c] = 1
         idx == H - 1 or grid[idx + 1][c] == '#' idx == H - 1 idx H - 1 H 1 grid[idx + 1][c] == '#' grid[idx + 1][c] [idx + 1] grid idx + 1 idx 1 c '#' H_cnt[idx][c] = 1 H_cnt[idx][c] [idx] H_cnt idx c 1 elif grid[idx][c] == '.' and (idx == H - 1 or grid[idx + 1][c] == '#'):
            cnt += 1
            for i in range(st, idx + 1):
                H_cnt[i][c] = cnt
         grid[idx][c] == '.' and (idx == H - 1 or grid[idx + 1][c] == '#') grid[idx][c] == '.' grid[idx][c] [idx] grid idx c '.' idx == H - 1 or grid[idx + 1][c] == '#' idx == H - 1 idx H - 1 H 1 grid[idx + 1][c] == '#' grid[idx + 1][c] [idx + 1] grid idx + 1 idx 1 c '#' cnt += 1 cnt 1 for i in range(st, idx + 1):
                H_cnt[i][c] = cnt
         i range(st, idx + 1) range st idx + 1 idx 1 H_cnt[i][c] = cnt H_cnt[i][c] [i] H_cnt i c cnt elif grid[idx][c] == '.':
            cnt += 1
         grid[idx][c] == '.' grid[idx][c] [idx] grid idx c '.' cnt += 1 cnt 1 elif grid[idx][c] == '#':
            pass

         grid[idx][c] == '#' grid[idx][c] [idx] grid idx c '#' idx += 1 idx 1 max_ = 0 max_ 0 for r in range(H):
    for c in range(W):
        max_ = max(max_, W_cnt[r][c] + H_cnt[r][c] - 1) r range(H) range H for c in range(W):
        max_ = max(max_, W_cnt[r][c] + H_cnt[r][c] - 1) c range(W) range W max_ = max(max_, W_cnt[r][c] + H_cnt[r][c] - 1) max_ max(max_, W_cnt[r][c] + H_cnt[r][c] - 1) max max_ W_cnt[r][c] + H_cnt[r][c] - 1 W_cnt[r][c] + H_cnt[r][c] W_cnt[r][c] [r] W_cnt r c H_cnt[r][c] [r] H_cnt r c 1 print(max_) print max_ H_cnt = [[0] * W for _ in range(H)] [[0] * W for _ in range(H)] H_cnt W = map(int, input().split()) map(int, input().split()) W cnt = 1 1 cnt cnt = 1 1 cnt st = idx idx st grid = [] [] grid cnt += 1 1 cnt cnt += 1 1 cnt idx += 1 1 idx max_ = max(max_, W_cnt[r][c] + H_cnt[r][c] - 1) max(max_, W_cnt[r][c] + H_cnt[r][c] - 1) max_ r = [] [] r cnt += 1 1 cnt idx += 1 1 idx W_cnt = [[0] * W for _ in range(H)] [[0] * W for _ in range(H)] W_cnt cnt += 1 1 cnt s = input() input() s max_ = 0 0 max_ H, W = map(int, input().split()) map(int, input().split()) H st = idx idx st idx = 0 0 idx idx = 0 0 idx
H, W = map(int, input().split())

grid = []

for i in range(H):
    s = input()
    r = []
    for j, x in enumerate(s):
        r.append(x)

    grid.append(r)


H_cnt = [[0] * W for _ in range(H)]
W_cnt = [[0] * W for _ in range(H)]

for r in range(H):
    idx = 0

    while idx < W:
        if grid[r][idx] == '.' and (idx == 0 or grid[r][idx - 1] == '#'):
            cnt = 1
            st = idx
            if idx == W - 1 or grid[r][idx + 1] == '#':
                W_cnt[r][idx] = 1
        elif grid[r][idx] == '.' and (idx == W - 1 or grid[r][idx + 1] == '#'):
            cnt += 1
            for i in range(st, idx + 1):
                W_cnt[r][i] = cnt
        elif grid[r][idx] == '.':
            cnt += 1
        elif grid[r][idx] == '#':
            pass

        idx += 1

for c in range(W):
    idx = 0

    while idx < H:
        if grid[idx][c] == '.' and (idx == 0 or grid[idx - 1][c] == '#'):
            cnt = 1
            st = idx
            if idx == H - 1 or grid[idx + 1][c] == '#':
                H_cnt[idx][c] = 1
        elif grid[idx][c] == '.' and (idx == H - 1 or grid[idx + 1][c] == '#'):
            cnt += 1
            for i in range(st, idx + 1):
                H_cnt[i][c] = cnt
        elif grid[idx][c] == '.':
            cnt += 1
        elif grid[idx][c] == '#':
            pass

        idx += 1

max_ = 0
for r in range(H):
    for c in range(W):
        max_ = max(max_, W_cnt[r][c] + H_cnt[r][c] - 1)

print(max_)
