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

S=[[0]*(W+2) for _ in range(H+2)]
for i in range(H):
    S[i+1]=[0]+list(map(lambda x:int(x=="."),input()))+[0]


R=[[0]*(W+2) for _ in range(H+2)]
L=[[0]*(W+2) for _ in range(H+2)]
U=[[0]*(W+2) for _ in range(H+2)]
D=[[0]*(W+2) for _ in range(H+2)]


for y in range(H+2):
    for x in range(W+2):
        if S[y][x]:
            R[y][x]=R[y][x-1]+1

for y in range(H+2):
    for x in range(W+1,-1,-1):
        if S[y][x]:
            L[y][x]=L[y][x+1]+1

for x in range(W+2):
    for y in range(H+2):
        if S[y][x]:
            D[y][x]=D[y-1][x]+1

for x in range(W+2):
    for y in range(H+1,-1,-1):
        if S[y][x]:
            U[y][x]=U[y+1][x]+1

A=[[0]*(W+2) for _ in range(H+2)]
for y in range(H+2):
    for x in range(W+2):
        A[y][x]=U[y][x]+D[y][x]+R[y][x]+L[y][x]-3

M=0
for y in range(H+2):
    M=max(M,max(A[y]))

print(M) H,W=map(int,input().split()) H map(int,input().split()) map int input().split() ().split () input split W [0]*(W+2) for _ in range(H+2) for _ in range(H+2) _ range(H+2) range H+2 H 2 for _ in range(H+2) [0]*(W+2) [0] 0 W+2 W 2 S=[[0]*(W+2) for _ in range(H+2)] S [[0]*(W+2) for _ in range(H+2)] for i in range(H):
    S[i+1]=[0]+list(map(lambda x:int(x=="."),input()))+[0] i range(H) range H S[i+1]=[0]+list(map(lambda x:int(x=="."),input()))+[0] S[i+1] S i+1 i 1 [0]+list(map(lambda x:int(x=="."),input()))+[0] [0]+list(map(lambda x:int(x=="."),input())) [0] 0 list(map(lambda x:int(x=="."),input())) list map(lambda x:int(x=="."),input()) map lambda x:int(x==".") int(x==".") int x=="." x "." x input() input [0] 0 [0]*(W+2) for _ in range(H+2) for _ in range(H+2) _ range(H+2) range H+2 H 2 for _ in range(H+2) [0]*(W+2) [0] 0 W+2 W 2 R=[[0]*(W+2) for _ in range(H+2)] R [[0]*(W+2) for _ in range(H+2)] [0]*(W+2) for _ in range(H+2) for _ in range(H+2) _ range(H+2) range H+2 H 2 for _ in range(H+2) [0]*(W+2) [0] 0 W+2 W 2 L=[[0]*(W+2) for _ in range(H+2)] L [[0]*(W+2) for _ in range(H+2)] [0]*(W+2) for _ in range(H+2) for _ in range(H+2) _ range(H+2) range H+2 H 2 for _ in range(H+2) [0]*(W+2) [0] 0 W+2 W 2 U=[[0]*(W+2) for _ in range(H+2)] U [[0]*(W+2) for _ in range(H+2)] [0]*(W+2) for _ in range(H+2) for _ in range(H+2) _ range(H+2) range H+2 H 2 for _ in range(H+2) [0]*(W+2) [0] 0 W+2 W 2 D=[[0]*(W+2) for _ in range(H+2)] D [[0]*(W+2) for _ in range(H+2)] for y in range(H+2):
    for x in range(W+2):
        if S[y][x]:
            R[y][x]=R[y][x-1]+1 y range(H+2) range H+2 H 2 for x in range(W+2):
        if S[y][x]:
            R[y][x]=R[y][x-1]+1 x range(W+2) range W+2 W 2 if S[y][x]:
            R[y][x]=R[y][x-1]+1 S[y][x] [y] S y x R[y][x]=R[y][x-1]+1 R[y][x] [y] R y x R[y][x-1]+1 R[y][x-1] [y] R y x-1 x 1 1 for y in range(H+2):
    for x in range(W+1,-1,-1):
        if S[y][x]:
            L[y][x]=L[y][x+1]+1 y range(H+2) range H+2 H 2 for x in range(W+1,-1,-1):
        if S[y][x]:
            L[y][x]=L[y][x+1]+1 x range(W+1,-1,-1) range W+1 W 1 -1 -1 if S[y][x]:
            L[y][x]=L[y][x+1]+1 S[y][x] [y] S y x L[y][x]=L[y][x+1]+1 L[y][x] [y] L y x L[y][x+1]+1 L[y][x+1] [y] L y x+1 x 1 1 for x in range(W+2):
    for y in range(H+2):
        if S[y][x]:
            D[y][x]=D[y-1][x]+1 x range(W+2) range W+2 W 2 for y in range(H+2):
        if S[y][x]:
            D[y][x]=D[y-1][x]+1 y range(H+2) range H+2 H 2 if S[y][x]:
            D[y][x]=D[y-1][x]+1 S[y][x] [y] S y x D[y][x]=D[y-1][x]+1 D[y][x] [y] D y x D[y-1][x]+1 D[y-1][x] [y-1] D y-1 y 1 x 1 for x in range(W+2):
    for y in range(H+1,-1,-1):
        if S[y][x]:
            U[y][x]=U[y+1][x]+1 x range(W+2) range W+2 W 2 for y in range(H+1,-1,-1):
        if S[y][x]:
            U[y][x]=U[y+1][x]+1 y range(H+1,-1,-1) range H+1 H 1 -1 -1 if S[y][x]:
            U[y][x]=U[y+1][x]+1 S[y][x] [y] S y x U[y][x]=U[y+1][x]+1 U[y][x] [y] U y x U[y+1][x]+1 U[y+1][x] [y+1] U y+1 y 1 x 1 [0]*(W+2) for _ in range(H+2) for _ in range(H+2) _ range(H+2) range H+2 H 2 for _ in range(H+2) [0]*(W+2) [0] 0 W+2 W 2 A=[[0]*(W+2) for _ in range(H+2)] A [[0]*(W+2) for _ in range(H+2)] for y in range(H+2):
    for x in range(W+2):
        A[y][x]=U[y][x]+D[y][x]+R[y][x]+L[y][x]-3 y range(H+2) range H+2 H 2 for x in range(W+2):
        A[y][x]=U[y][x]+D[y][x]+R[y][x]+L[y][x]-3 x range(W+2) range W+2 W 2 A[y][x]=U[y][x]+D[y][x]+R[y][x]+L[y][x]-3 A[y][x] [y] A y x U[y][x]+D[y][x]+R[y][x]+L[y][x]-3 U[y][x]+D[y][x]+R[y][x]+L[y][x] U[y][x]+D[y][x]+R[y][x] U[y][x]+D[y][x] U[y][x] [y] U y x D[y][x] [y] D y x R[y][x] [y] R y x L[y][x] [y] L y x 3 M=0 M 0 for y in range(H+2):
    M=max(M,max(A[y])) y range(H+2) range H+2 H 2 M=max(M,max(A[y])) M max(M,max(A[y])) max M max(A[y]) max A[y] A y print(M) print M H,W=map(int,input().split()) map(int,input().split()) H W=map(int,input().split()) map(int,input().split()) W A=[[0]*(W+2) for _ in range(H+2)] [[0]*(W+2) for _ in range(H+2)] A M=0 0 M M=max(M,max(A[y])) max(M,max(A[y])) M L=[[0]*(W+2) for _ in range(H+2)] [[0]*(W+2) for _ in range(H+2)] L U=[[0]*(W+2) for _ in range(H+2)] [[0]*(W+2) for _ in range(H+2)] U R=[[0]*(W+2) for _ in range(H+2)] [[0]*(W+2) for _ in range(H+2)] R S=[[0]*(W+2) for _ in range(H+2)] [[0]*(W+2) for _ in range(H+2)] S D=[[0]*(W+2) for _ in range(H+2)] [[0]*(W+2) for _ in range(H+2)] D
H,W=map(int,input().split())

S=[[0]*(W+2) for _ in range(H+2)]
for i in range(H):
    S[i+1]=[0]+list(map(lambda x:int(x=="."),input()))+[0]


R=[[0]*(W+2) for _ in range(H+2)]
L=[[0]*(W+2) for _ in range(H+2)]
U=[[0]*(W+2) for _ in range(H+2)]
D=[[0]*(W+2) for _ in range(H+2)]


for y in range(H+2):
    for x in range(W+2):
        if S[y][x]:
            R[y][x]=R[y][x-1]+1

for y in range(H+2):
    for x in range(W+1,-1,-1):
        if S[y][x]:
            L[y][x]=L[y][x+1]+1

for x in range(W+2):
    for y in range(H+2):
        if S[y][x]:
            D[y][x]=D[y-1][x]+1

for x in range(W+2):
    for y in range(H+1,-1,-1):
        if S[y][x]:
            U[y][x]=U[y+1][x]+1

A=[[0]*(W+2) for _ in range(H+2)]
for y in range(H+2):
    for x in range(W+2):
        A[y][x]=U[y][x]+D[y][x]+R[y][x]+L[y][x]-3

M=0
for y in range(H+2):
    M=max(M,max(A[y]))

print(M)