h, w = map(int, input().split())
chiz = [[] for _ in range(w)]
for _ in range(h):
    tmp_list = input()
    for i in range(w):
        chiz[i].append(tmp_list[i])
rsw_w = [[0]*h for _ in range(w)]
rsw_h = [[0]*h for _ in range(w)]
for j in range(h):
    for i in range(w):
        if chiz[i][j] == '.':
            if i > 0:
                rsw_w[i][j] = rsw_w[i-1][j] + 1
            else:
                rsw_w[i][j] = 1
for j in range(h):
    for i in reversed(range(w)):
        if chiz[i][j] == '.':
            if i < w-1:
                rsw_w[i][j] = max(rsw_w[i][j],rsw_w[i+1][j])
for i in range(w):
    for j in range(h):
        if chiz[i][j] == '.':
            if j > 0:
                rsw_h[i][j] = rsw_h[i][j-1] + 1
            else:
                rsw_h[i][j] = 1
for i in range(w):
    for j in reversed(range(h)):
        if chiz[i][j] == '.':
            if j < h-1:
                rsw_h[i][j] = max(rsw_h[i][j],rsw_h[i][j+1])
res = 0
for j in range(h):
    for i in range(w):
       res = max(res,rsw_w[i][j]+rsw_h[i][j]-1)
print(res) h, w = map(int, input().split()) h map(int, input().split()) map int input().split() ().split () input split w [] for _ in range(w) for _ in range(w) _ range(w) range w for _ in range(w) [] chiz = [[] for _ in range(w)] chiz [[] for _ in range(w)] for _ in range(h):
    tmp_list = input()
    for i in range(w):
        chiz[i].append(tmp_list[i]) _ range(h) range h tmp_list = input() tmp_list input() input for i in range(w):
        chiz[i].append(tmp_list[i]) i range(w) range w chiz[i].append(tmp_list[i]) [i].append [i] chiz i append tmp_list[i] tmp_list i [0]*h for _ in range(w) for _ in range(w) _ range(w) range w for _ in range(w) [0]*h [0] 0 h rsw_w = [[0]*h for _ in range(w)] rsw_w [[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 rsw_h = [[0]*h for _ in range(w)] rsw_h [[0]*h for _ in range(w)] for j in range(h):
    for i in range(w):
        if chiz[i][j] == '.':
            if i > 0:
                rsw_w[i][j] = rsw_w[i-1][j] + 1
            else:
                rsw_w[i][j] = 1 j range(h) range h for i in range(w):
        if chiz[i][j] == '.':
            if i > 0:
                rsw_w[i][j] = rsw_w[i-1][j] + 1
            else:
                rsw_w[i][j] = 1 i range(w) range w if chiz[i][j] == '.':
            if i > 0:
                rsw_w[i][j] = rsw_w[i-1][j] + 1
            else:
                rsw_w[i][j] = 1 chiz[i][j] == '.' chiz[i][j] [i] chiz i j '.' if i > 0:
                rsw_w[i][j] = rsw_w[i-1][j] + 1
            else:
                rsw_w[i][j] = 1 i > 0 i 0 rsw_w[i][j] = rsw_w[i-1][j] + 1 rsw_w[i][j] [i] rsw_w i j rsw_w[i-1][j] + 1 rsw_w[i-1][j] [i-1] rsw_w i-1 i 1 j 1 rsw_w[i][j] = 1 rsw_w[i][j] [i] rsw_w i j 1 for j in range(h):
    for i in reversed(range(w)):
        if chiz[i][j] == '.':
            if i < w-1:
                rsw_w[i][j] = max(rsw_w[i][j],rsw_w[i+1][j]) j range(h) range h for i in reversed(range(w)):
        if chiz[i][j] == '.':
            if i < w-1:
                rsw_w[i][j] = max(rsw_w[i][j],rsw_w[i+1][j]) i reversed(range(w)) reversed range(w) range w if chiz[i][j] == '.':
            if i < w-1:
                rsw_w[i][j] = max(rsw_w[i][j],rsw_w[i+1][j]) chiz[i][j] == '.' chiz[i][j] [i] chiz i j '.' if i < w-1:
                rsw_w[i][j] = max(rsw_w[i][j],rsw_w[i+1][j]) i < w-1 i w-1 w 1 rsw_w[i][j] = max(rsw_w[i][j],rsw_w[i+1][j]) rsw_w[i][j] [i] rsw_w i j max(rsw_w[i][j],rsw_w[i+1][j]) max rsw_w[i][j] [i] rsw_w i j rsw_w[i+1][j] [i+1] rsw_w i+1 i 1 j for i in range(w):
    for j in range(h):
        if chiz[i][j] == '.':
            if j > 0:
                rsw_h[i][j] = rsw_h[i][j-1] + 1
            else:
                rsw_h[i][j] = 1 i range(w) range w for j in range(h):
        if chiz[i][j] == '.':
            if j > 0:
                rsw_h[i][j] = rsw_h[i][j-1] + 1
            else:
                rsw_h[i][j] = 1 j range(h) range h if chiz[i][j] == '.':
            if j > 0:
                rsw_h[i][j] = rsw_h[i][j-1] + 1
            else:
                rsw_h[i][j] = 1 chiz[i][j] == '.' chiz[i][j] [i] chiz i j '.' if j > 0:
                rsw_h[i][j] = rsw_h[i][j-1] + 1
            else:
                rsw_h[i][j] = 1 j > 0 j 0 rsw_h[i][j] = rsw_h[i][j-1] + 1 rsw_h[i][j] [i] rsw_h i j rsw_h[i][j-1] + 1 rsw_h[i][j-1] [i] rsw_h i j-1 j 1 1 rsw_h[i][j] = 1 rsw_h[i][j] [i] rsw_h i j 1 for i in range(w):
    for j in reversed(range(h)):
        if chiz[i][j] == '.':
            if j < h-1:
                rsw_h[i][j] = max(rsw_h[i][j],rsw_h[i][j+1]) i range(w) range w for j in reversed(range(h)):
        if chiz[i][j] == '.':
            if j < h-1:
                rsw_h[i][j] = max(rsw_h[i][j],rsw_h[i][j+1]) j reversed(range(h)) reversed range(h) range h if chiz[i][j] == '.':
            if j < h-1:
                rsw_h[i][j] = max(rsw_h[i][j],rsw_h[i][j+1]) chiz[i][j] == '.' chiz[i][j] [i] chiz i j '.' if j < h-1:
                rsw_h[i][j] = max(rsw_h[i][j],rsw_h[i][j+1]) j < h-1 j h-1 h 1 rsw_h[i][j] = max(rsw_h[i][j],rsw_h[i][j+1]) rsw_h[i][j] [i] rsw_h i j max(rsw_h[i][j],rsw_h[i][j+1]) max rsw_h[i][j] [i] rsw_h i j rsw_h[i][j+1] [i] rsw_h i j+1 j 1 res = 0 res 0 for j in range(h):
    for i in range(w):
       res = max(res,rsw_w[i][j]+rsw_h[i][j]-1) j range(h) range h for i in range(w):
       res = max(res,rsw_w[i][j]+rsw_h[i][j]-1) i range(w) range w res = max(res,rsw_w[i][j]+rsw_h[i][j]-1) res max(res,rsw_w[i][j]+rsw_h[i][j]-1) max res rsw_w[i][j]+rsw_h[i][j]-1 rsw_w[i][j]+rsw_h[i][j] rsw_w[i][j] [i] rsw_w i j rsw_h[i][j] [i] rsw_h i j 1 print(res) print res res = max(res,rsw_w[i][j]+rsw_h[i][j]-1) max(res,rsw_w[i][j]+rsw_h[i][j]-1) res rsw_h = [[0]*h for _ in range(w)] [[0]*h for _ in range(w)] rsw_h h, w = map(int, input().split()) map(int, input().split()) h chiz = [[] for _ in range(w)] [[] for _ in range(w)] chiz res = 0 0 res w = map(int, input().split()) map(int, input().split()) w tmp_list = input() input() tmp_list rsw_w = [[0]*h for _ in range(w)] [[0]*h for _ in range(w)] rsw_w
h, w = map(int, input().split())
chiz = [[] for _ in range(w)]
for _ in range(h):
    tmp_list = input()
    for i in range(w):
        chiz[i].append(tmp_list[i])
rsw_w = [[0]*h for _ in range(w)]
rsw_h = [[0]*h for _ in range(w)]
for j in range(h):
    for i in range(w):
        if chiz[i][j] == '.':
            if i > 0:
                rsw_w[i][j] = rsw_w[i-1][j] + 1
            else:
                rsw_w[i][j] = 1
for j in range(h):
    for i in reversed(range(w)):
        if chiz[i][j] == '.':
            if i < w-1:
                rsw_w[i][j] = max(rsw_w[i][j],rsw_w[i+1][j])
for i in range(w):
    for j in range(h):
        if chiz[i][j] == '.':
            if j > 0:
                rsw_h[i][j] = rsw_h[i][j-1] + 1
            else:
                rsw_h[i][j] = 1
for i in range(w):
    for j in reversed(range(h)):
        if chiz[i][j] == '.':
            if j < h-1:
                rsw_h[i][j] = max(rsw_h[i][j],rsw_h[i][j+1])
res = 0
for j in range(h):
    for i in range(w):
       res = max(res,rsw_w[i][j]+rsw_h[i][j]-1)
print(res)