from collections import deque

H,W = map(int, input().split())
Ss = [str(input()) for _ in range(H)]

yoko = [[0 for _ in range(W)] for _ in range(H)]
tate = [[0 for _ in range(W)] for _ in range(H)]

for i in range(H):
    for j in range(W):
        if Ss[i][j] == "#" or yoko[i][j] != 0:
            continue
        else:
            paths = [[i,j]]
            temp = 1
            for k in range(j+1, W):
                if Ss[i][k] == ".":
                    temp+=1
                    paths.append([i,k])
                else:
                    break
            for path in paths:
                yoko[path[0]][path[1]] = temp

for i in range(H):
    for j in range(W):
        if Ss[i][j] == "#" or tate[i][j] != 0:
            continue
        else:
            paths = [[i,j]]
            temp = 1
            for k in range(i+1, H):
                if Ss[k][j] == ".":
                    temp+=1
                    paths.append([k,j])
                else:
                    break
            for path in paths:
                tate[path[0]][path[1]] = temp

answer = 0
for i in range(H):
    for j in range(W):
        if answer < tate[i][j]+yoko[i][j]-1:
            answer = tate[i][j]+yoko[i][j]-1
print(answer) from collections import deque H,W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W str(input()) for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) str(input()) str input() input Ss = [str(input()) for _ in range(H)] Ss [str(input()) for _ in range(H)] [0 for _ in range(W)] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0 for _ in range(W)] yoko = [[0 for _ in range(W)] for _ in range(H)] yoko [[0 for _ in range(W)] for _ in range(H)] [0 for _ in range(W)] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0 for _ in range(W)] tate = [[0 for _ in range(W)] for _ in range(H)] tate [[0 for _ in range(W)] for _ in range(H)] for i in range(H):
    for j in range(W):
        if Ss[i][j] == "#" or yoko[i][j] != 0:
            continue
        else:
            paths = [[i,j]]
            temp = 1
            for k in range(j+1, W):
                if Ss[i][k] == ".":
                    temp+=1
                    paths.append([i,k])
                else:
                    break
            for path in paths:
                yoko[path[0]][path[1]] = temp i range(H) range H for j in range(W):
        if Ss[i][j] == "#" or yoko[i][j] != 0:
            continue
        else:
            paths = [[i,j]]
            temp = 1
            for k in range(j+1, W):
                if Ss[i][k] == ".":
                    temp+=1
                    paths.append([i,k])
                else:
                    break
            for path in paths:
                yoko[path[0]][path[1]] = temp j range(W) range W if Ss[i][j] == "#" or yoko[i][j] != 0:
            continue
        else:
            paths = [[i,j]]
            temp = 1
            for k in range(j+1, W):
                if Ss[i][k] == ".":
                    temp+=1
                    paths.append([i,k])
                else:
                    break
            for path in paths:
                yoko[path[0]][path[1]] = temp Ss[i][j] == "#" or yoko[i][j] != 0 Ss[i][j] == "#" Ss[i][j] [i] Ss i j "#" yoko[i][j] != 0 yoko[i][j] [i] yoko i j 0 continue paths = [[i,j]] paths [[i,j]] [i,j] i j temp = 1 temp 1 for k in range(j+1, W):
                if Ss[i][k] == ".":
                    temp+=1
                    paths.append([i,k])
                else:
                    break
             k range(j+1, W) range j+1 j 1 W if Ss[i][k] == ".":
                    temp+=1
                    paths.append([i,k])
                else:
                    break
             Ss[i][k] == "." Ss[i][k] [i] Ss i k "." temp+=1 temp 1 paths.append([i,k]) paths.append paths append [i,k] i k break for path in paths:
                yoko[path[0]][path[1]] = temp path paths yoko[path[0]][path[1]] = temp yoko[path[0]][path[1]] [path[0]] yoko path[0] path 0 path[1] path 1 temp for i in range(H):
    for j in range(W):
        if Ss[i][j] == "#" or tate[i][j] != 0:
            continue
        else:
            paths = [[i,j]]
            temp = 1
            for k in range(i+1, H):
                if Ss[k][j] == ".":
                    temp+=1
                    paths.append([k,j])
                else:
                    break
            for path in paths:
                tate[path[0]][path[1]] = temp i range(H) range H for j in range(W):
        if Ss[i][j] == "#" or tate[i][j] != 0:
            continue
        else:
            paths = [[i,j]]
            temp = 1
            for k in range(i+1, H):
                if Ss[k][j] == ".":
                    temp+=1
                    paths.append([k,j])
                else:
                    break
            for path in paths:
                tate[path[0]][path[1]] = temp j range(W) range W if Ss[i][j] == "#" or tate[i][j] != 0:
            continue
        else:
            paths = [[i,j]]
            temp = 1
            for k in range(i+1, H):
                if Ss[k][j] == ".":
                    temp+=1
                    paths.append([k,j])
                else:
                    break
            for path in paths:
                tate[path[0]][path[1]] = temp Ss[i][j] == "#" or tate[i][j] != 0 Ss[i][j] == "#" Ss[i][j] [i] Ss i j "#" tate[i][j] != 0 tate[i][j] [i] tate i j 0 continue paths = [[i,j]] paths [[i,j]] [i,j] i j temp = 1 temp 1 for k in range(i+1, H):
                if Ss[k][j] == ".":
                    temp+=1
                    paths.append([k,j])
                else:
                    break
             k range(i+1, H) range i+1 i 1 H if Ss[k][j] == ".":
                    temp+=1
                    paths.append([k,j])
                else:
                    break
             Ss[k][j] == "." Ss[k][j] [k] Ss k j "." temp+=1 temp 1 paths.append([k,j]) paths.append paths append [k,j] k j break for path in paths:
                tate[path[0]][path[1]] = temp path paths tate[path[0]][path[1]] = temp tate[path[0]][path[1]] [path[0]] tate path[0] path 0 path[1] path 1 temp answer = 0 answer 0 for i in range(H):
    for j in range(W):
        if answer < tate[i][j]+yoko[i][j]-1:
            answer = tate[i][j]+yoko[i][j]-1 i range(H) range H for j in range(W):
        if answer < tate[i][j]+yoko[i][j]-1:
            answer = tate[i][j]+yoko[i][j]-1 j range(W) range W if answer < tate[i][j]+yoko[i][j]-1:
            answer = tate[i][j]+yoko[i][j]-1 answer < tate[i][j]+yoko[i][j]-1 answer tate[i][j]+yoko[i][j]-1 tate[i][j]+yoko[i][j] tate[i][j] [i] tate i j yoko[i][j] [i] yoko i j 1 answer = tate[i][j]+yoko[i][j]-1 answer tate[i][j]+yoko[i][j]-1 tate[i][j]+yoko[i][j] tate[i][j] [i] tate i j yoko[i][j] [i] yoko i j 1 print(answer) print answer Ss = [str(input()) for _ in range(H)] [str(input()) for _ in range(H)] Ss temp+=1 1 temp yoko = [[0 for _ in range(W)] for _ in range(H)] [[0 for _ in range(W)] for _ in range(H)] yoko answer = tate[i][j]+yoko[i][j]-1 tate[i][j]+yoko[i][j]-1 answer paths = [[i,j]] [[i,j]] paths H,W = map(int, input().split()) map(int, input().split()) H temp+=1 1 temp answer = 0 0 answer temp = 1 1 temp W = map(int, input().split()) map(int, input().split()) W temp = 1 1 temp paths = [[i,j]] [[i,j]] paths tate = [[0 for _ in range(W)] for _ in range(H)] [[0 for _ in range(W)] for _ in range(H)] tate
from collections import deque

H,W = map(int, input().split())
Ss = [str(input()) for _ in range(H)]

yoko = [[0 for _ in range(W)] for _ in range(H)]
tate = [[0 for _ in range(W)] for _ in range(H)]

for i in range(H):
    for j in range(W):
        if Ss[i][j] == "#" or yoko[i][j] != 0:
            continue
        else:
            paths = [[i,j]]
            temp = 1
            for k in range(j+1, W):
                if Ss[i][k] == ".":
                    temp+=1
                    paths.append([i,k])
                else:
                    break
            for path in paths:
                yoko[path[0]][path[1]] = temp

for i in range(H):
    for j in range(W):
        if Ss[i][j] == "#" or tate[i][j] != 0:
            continue
        else:
            paths = [[i,j]]
            temp = 1
            for k in range(i+1, H):
                if Ss[k][j] == ".":
                    temp+=1
                    paths.append([k,j])
                else:
                    break
            for path in paths:
                tate[path[0]][path[1]] = temp

answer = 0
for i in range(H):
    for j in range(W):
        if answer < tate[i][j]+yoko[i][j]-1:
            answer = tate[i][j]+yoko[i][j]-1
print(answer)