h,w=map(int,input().split())

M=[]
for i in range(h):
    M.append(input())

L=[]
for j in range(h):
    Lj=[]
    for i in range(w):
        if M[j][i]=="#":
            Lj.append(0)
        elif i==0:
            Lj.append(1)
        else:
            Lj.append(Lj[i-1]+1)
    L.append(Lj)
R=[]
for j in range(h):
    Rj=[]
    for i in range(w):
        if M[j][w-1-i]=="#":
            Rj.append(0)
        elif i==0:
            Rj.append(1)
        else:
            Rj.append(Rj[i-1]+1)
    R.append(Rj)   
U=[]
for i in range(w):
    Ui=[]
    for j in range(h):
        if M[j][i]=="#":
            Ui.append(0)
        elif j==0:
            Ui.append(1)
        else:
            Ui.append(Ui[j-1]+1)
    U.append(Ui)
D=[]
for i in range(w):
    Di=[]
    for j in range(h):
        if M[h-1-j][i]=="#":
            Di.append(0)
        elif j==0:
            Di.append(1)
        else:
            Di.append(Di[j-1]+1)
    D.append(Di)

s=0
for i in range(w):
    for j in range(h):
        s=max(s,L[j][i]+R[j][w-1-i]+U[i][j]+D[i][h-1-j]-3)

print(s) h,w=map(int,input().split()) h map(int,input().split()) map int input().split() ().split () input split w M=[] M [] for i in range(h):
    M.append(input()) i range(h) range h M.append(input()) M.append M append input() input L=[] L [] for j in range(h):
    Lj=[]
    for i in range(w):
        if M[j][i]=="#":
            Lj.append(0)
        elif i==0:
            Lj.append(1)
        else:
            Lj.append(Lj[i-1]+1)
    L.append(Lj) j range(h) range h Lj=[] Lj [] for i in range(w):
        if M[j][i]=="#":
            Lj.append(0)
        elif i==0:
            Lj.append(1)
        else:
            Lj.append(Lj[i-1]+1)
     i range(w) range w if M[j][i]=="#":
            Lj.append(0)
        elif i==0:
            Lj.append(1)
        else:
            Lj.append(Lj[i-1]+1)
     M[j][i]=="#" M[j][i] [j] M j i "#" Lj.append(0) Lj.append Lj append 0 elif i==0:
            Lj.append(1)
         i==0 i 0 Lj.append(1) Lj.append Lj append 1 Lj.append(Lj[i-1]+1) Lj.append Lj append Lj[i-1]+1 Lj[i-1] Lj i-1 i 1 1 L.append(Lj) L.append L append Lj R=[] R [] for j in range(h):
    Rj=[]
    for i in range(w):
        if M[j][w-1-i]=="#":
            Rj.append(0)
        elif i==0:
            Rj.append(1)
        else:
            Rj.append(Rj[i-1]+1)
    R.append(Rj)    j range(h) range h Rj=[] Rj [] for i in range(w):
        if M[j][w-1-i]=="#":
            Rj.append(0)
        elif i==0:
            Rj.append(1)
        else:
            Rj.append(Rj[i-1]+1)
     i range(w) range w if M[j][w-1-i]=="#":
            Rj.append(0)
        elif i==0:
            Rj.append(1)
        else:
            Rj.append(Rj[i-1]+1)
     M[j][w-1-i]=="#" M[j][w-1-i] [j] M j w-1-i w-1 w 1 i "#" Rj.append(0) Rj.append Rj append 0 elif i==0:
            Rj.append(1)
         i==0 i 0 Rj.append(1) Rj.append Rj append 1 Rj.append(Rj[i-1]+1) Rj.append Rj append Rj[i-1]+1 Rj[i-1] Rj i-1 i 1 1 R.append(Rj) R.append R append Rj U=[] U [] for i in range(w):
    Ui=[]
    for j in range(h):
        if M[j][i]=="#":
            Ui.append(0)
        elif j==0:
            Ui.append(1)
        else:
            Ui.append(Ui[j-1]+1)
    U.append(Ui) i range(w) range w Ui=[] Ui [] for j in range(h):
        if M[j][i]=="#":
            Ui.append(0)
        elif j==0:
            Ui.append(1)
        else:
            Ui.append(Ui[j-1]+1)
     j range(h) range h if M[j][i]=="#":
            Ui.append(0)
        elif j==0:
            Ui.append(1)
        else:
            Ui.append(Ui[j-1]+1)
     M[j][i]=="#" M[j][i] [j] M j i "#" Ui.append(0) Ui.append Ui append 0 elif j==0:
            Ui.append(1)
         j==0 j 0 Ui.append(1) Ui.append Ui append 1 Ui.append(Ui[j-1]+1) Ui.append Ui append Ui[j-1]+1 Ui[j-1] Ui j-1 j 1 1 U.append(Ui) U.append U append Ui D=[] D [] for i in range(w):
    Di=[]
    for j in range(h):
        if M[h-1-j][i]=="#":
            Di.append(0)
        elif j==0:
            Di.append(1)
        else:
            Di.append(Di[j-1]+1)
    D.append(Di) i range(w) range w Di=[] Di [] for j in range(h):
        if M[h-1-j][i]=="#":
            Di.append(0)
        elif j==0:
            Di.append(1)
        else:
            Di.append(Di[j-1]+1)
     j range(h) range h if M[h-1-j][i]=="#":
            Di.append(0)
        elif j==0:
            Di.append(1)
        else:
            Di.append(Di[j-1]+1)
     M[h-1-j][i]=="#" M[h-1-j][i] [h-1-j] M h-1-j h-1 h 1 j i "#" Di.append(0) Di.append Di append 0 elif j==0:
            Di.append(1)
         j==0 j 0 Di.append(1) Di.append Di append 1 Di.append(Di[j-1]+1) Di.append Di append Di[j-1]+1 Di[j-1] Di j-1 j 1 1 D.append(Di) D.append D append Di s=0 s 0 for i in range(w):
    for j in range(h):
        s=max(s,L[j][i]+R[j][w-1-i]+U[i][j]+D[i][h-1-j]-3) i range(w) range w for j in range(h):
        s=max(s,L[j][i]+R[j][w-1-i]+U[i][j]+D[i][h-1-j]-3) j range(h) range h s=max(s,L[j][i]+R[j][w-1-i]+U[i][j]+D[i][h-1-j]-3) s max(s,L[j][i]+R[j][w-1-i]+U[i][j]+D[i][h-1-j]-3) max s L[j][i]+R[j][w-1-i]+U[i][j]+D[i][h-1-j]-3 L[j][i]+R[j][w-1-i]+U[i][j]+D[i][h-1-j] L[j][i]+R[j][w-1-i]+U[i][j] L[j][i]+R[j][w-1-i] L[j][i] [j] L j i R[j][w-1-i] [j] R j w-1-i w-1 w 1 i U[i][j] [i] U i j D[i][h-1-j] [i] D i h-1-j h-1 h 1 j 3 print(s) print s s=0 0 s Rj=[] [] Rj U=[] [] U h,w=map(int,input().split()) map(int,input().split()) h Lj=[] [] Lj Ui=[] [] Ui R=[] [] R s=max(s,L[j][i]+R[j][w-1-i]+U[i][j]+D[i][h-1-j]-3) max(s,L[j][i]+R[j][w-1-i]+U[i][j]+D[i][h-1-j]-3) s Di=[] [] Di w=map(int,input().split()) map(int,input().split()) w D=[] [] D M=[] [] M L=[] [] L
h,w=map(int,input().split())

M=[]
for i in range(h):
    M.append(input())

L=[]
for j in range(h):
    Lj=[]
    for i in range(w):
        if M[j][i]=="#":
            Lj.append(0)
        elif i==0:
            Lj.append(1)
        else:
            Lj.append(Lj[i-1]+1)
    L.append(Lj)
R=[]
for j in range(h):
    Rj=[]
    for i in range(w):
        if M[j][w-1-i]=="#":
            Rj.append(0)
        elif i==0:
            Rj.append(1)
        else:
            Rj.append(Rj[i-1]+1)
    R.append(Rj)   
U=[]
for i in range(w):
    Ui=[]
    for j in range(h):
        if M[j][i]=="#":
            Ui.append(0)
        elif j==0:
            Ui.append(1)
        else:
            Ui.append(Ui[j-1]+1)
    U.append(Ui)
D=[]
for i in range(w):
    Di=[]
    for j in range(h):
        if M[h-1-j][i]=="#":
            Di.append(0)
        elif j==0:
            Di.append(1)
        else:
            Di.append(Di[j-1]+1)
    D.append(Di)

s=0
for i in range(w):
    for j in range(h):
        s=max(s,L[j][i]+R[j][w-1-i]+U[i][j]+D[i][h-1-j]-3)

print(s)