h,w = list(map(int, input().split()))
b = [input() + '#' for _ in range(h)]
b.append('#' * (w + 1))
ans = [[0]*w for _ in range(h)]

for r in range(h):
    c = 0
    while c < w:
        if b[r][c] == '#':
            c += 1
        else:
            st = c
            while b[r][c] == '.':
                c += 1
            for i in range(st, c):
                ans[r][i] += (c - st)

for c in range(w):
    r = 0
    while r < h:
        if b[r][c] == '#':
            r += 1
        else:
            st = r
            while b[r][c] == '.':
                r += 1
            for i in range(st, r):
                ans[i][c] += (r - st)

import itertools
print(max(itertools.chain.from_iterable(ans))-1) h,w = list(map(int, input().split())) h list(map(int, input().split())) list 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() input '#' b = [input() + '#' for _ in range(h)] b [input() + '#' for _ in range(h)] b.append('#' * (w + 1)) b.append b append '#' * (w + 1) '#' w + 1 w 1 [0]*w for _ in range(h) for _ in range(h) _ range(h) range h for _ in range(h) [0]*w [0] 0 w ans = [[0]*w for _ in range(h)] ans [[0]*w for _ in range(h)] for r in range(h):
    c = 0
    while c < w:
        if b[r][c] == '#':
            c += 1
        else:
            st = c
            while b[r][c] == '.':
                c += 1
            for i in range(st, c):
                ans[r][i] += (c - st) r range(h) range h c = 0 c 0 while c < w:
        if b[r][c] == '#':
            c += 1
        else:
            st = c
            while b[r][c] == '.':
                c += 1
            for i in range(st, c):
                ans[r][i] += (c - st) c < w c w if b[r][c] == '#':
            c += 1
        else:
            st = c
            while b[r][c] == '.':
                c += 1
            for i in range(st, c):
                ans[r][i] += (c - st) b[r][c] == '#' b[r][c] [r] b r c '#' c += 1 c 1 st = c st c while b[r][c] == '.':
                c += 1
             b[r][c] == '.' b[r][c] [r] b r c '.' c += 1 c 1 for i in range(st, c):
                ans[r][i] += (c - st) i range(st, c) range st c ans[r][i] += (c - st) ans[r][i] [r] ans r i c - st c st for c in range(w):
    r = 0
    while r < h:
        if b[r][c] == '#':
            r += 1
        else:
            st = r
            while b[r][c] == '.':
                r += 1
            for i in range(st, r):
                ans[i][c] += (r - st) c range(w) range w r = 0 r 0 while r < h:
        if b[r][c] == '#':
            r += 1
        else:
            st = r
            while b[r][c] == '.':
                r += 1
            for i in range(st, r):
                ans[i][c] += (r - st) r < h r h if b[r][c] == '#':
            r += 1
        else:
            st = r
            while b[r][c] == '.':
                r += 1
            for i in range(st, r):
                ans[i][c] += (r - st) b[r][c] == '#' b[r][c] [r] b r c '#' r += 1 r 1 st = r st r while b[r][c] == '.':
                r += 1
             b[r][c] == '.' b[r][c] [r] b r c '.' r += 1 r 1 for i in range(st, r):
                ans[i][c] += (r - st) i range(st, r) range st r ans[i][c] += (r - st) ans[i][c] [i] ans i c r - st r st import itertools itertools print(max(itertools.chain.from_iterable(ans))-1) print max(itertools.chain.from_iterable(ans))-1 max(itertools.chain.from_iterable(ans)) max itertools.chain.from_iterable(ans) itertools.chain.from_iterable itertools.chain itertools chain from_iterable ans 1 r += 1 1 r c = 0 0 c r += 1 1 r c += 1 1 c c += 1 1 c h,w = list(map(int, input().split())) list(map(int, input().split())) h ans = [[0]*w for _ in range(h)] [[0]*w for _ in range(h)] ans st = r r st st = c c st w = list(map(int, input().split())) list(map(int, input().split())) w b = [input() + '#' for _ in range(h)] [input() + '#' for _ in range(h)] b r = 0 0 r
h,w = list(map(int, input().split()))
b = [input() + '#' for _ in range(h)]
b.append('#' * (w + 1))
ans = [[0]*w for _ in range(h)]

for r in range(h):
    c = 0
    while c < w:
        if b[r][c] == '#':
            c += 1
        else:
            st = c
            while b[r][c] == '.':
                c += 1
            for i in range(st, c):
                ans[r][i] += (c - st)

for c in range(w):
    r = 0
    while r < h:
        if b[r][c] == '#':
            r += 1
        else:
            st = r
            while b[r][c] == '.':
                r += 1
            for i in range(st, r):
                ans[i][c] += (r - st)

import itertools
print(max(itertools.chain.from_iterable(ans))-1)
