H,W = map(int,input().split())
S = [list(input()) for i in range(0,H,1)]

teraseru_H = [[0 for i in range(0,W,1)]for j in range(0,H,1)]
teraseru_W = [[0 for i in range(0,W,1)]for j in range(0,H,1)]

left = -1
for i in range(0,H,1):
    left=-1
    for j in range(0,W,1):
        if S[i][j]=="#":
            if left!=-1:
                for k in range(left,j,1):
                    teraseru_H[i][k] = j-left
                left=-1

        else:#"."
            if left==-1:
                left=j
    if left!=-1:
        for k in range(left,W,1):
            teraseru_H[i][k] = W-left
    left=-1

left = -1
for j in range(0,W,1):
    left=-1
    for i in range(0,H,1):
        if S[i][j]=="#":
            if left!=-1:
                for k in range(left,i,1):
                    teraseru_W[k][j] = i-left
                left=-1
        else:#"."
            if left==-1:
                left=i
    if left!=-1:
        for k in range(left,H,1):
            teraseru_W[k][j] = H-left
    left=-1

ans = 0

for i in range(0,H,1):
    for j in range(0,W,1):
        ans = max(ans,teraseru_H[i][j]+teraseru_W[i][j]-1)
print(ans) H,W = map(int,input().split()) H map(int,input().split()) map int input().split() ().split () input split W list(input()) for i in range(0,H,1) for i in range(0,H,1) i range(0,H,1) range 0 H 1 for i in range(0,H,1) list(input()) list input() input S = [list(input()) for i in range(0,H,1)] S [list(input()) for i in range(0,H,1)] [0 for i in range(0,W,1)]for j in range(0,H,1) for j in range(0,H,1) j range(0,H,1) range 0 H 1 for j in range(0,H,1) [0 for i in range(0,W,1)] teraseru_H = [[0 for i in range(0,W,1)]for j in range(0,H,1)] teraseru_H [[0 for i in range(0,W,1)]for j in range(0,H,1)] [0 for i in range(0,W,1)]for j in range(0,H,1) for j in range(0,H,1) j range(0,H,1) range 0 H 1 for j in range(0,H,1) [0 for i in range(0,W,1)] teraseru_W = [[0 for i in range(0,W,1)]for j in range(0,H,1)] teraseru_W [[0 for i in range(0,W,1)]for j in range(0,H,1)] left = -1 left -1 for i in range(0,H,1):
    left=-1
    for j in range(0,W,1):
        if S[i][j]=="#":
            if left!=-1:
                for k in range(left,j,1):
                    teraseru_H[i][k] = j-left
                left=-1

        else:#"."
            if left==-1:
                left=j
    if left!=-1:
        for k in range(left,W,1):
            teraseru_H[i][k] = W-left
    left=-1 i range(0,H,1) range 0 H 1 left=-1 left -1 for j in range(0,W,1):
        if S[i][j]=="#":
            if left!=-1:
                for k in range(left,j,1):
                    teraseru_H[i][k] = j-left
                left=-1

        else:#"."
            if left==-1:
                left=j
     j range(0,W,1) range 0 W 1 if S[i][j]=="#":
            if left!=-1:
                for k in range(left,j,1):
                    teraseru_H[i][k] = j-left
                left=-1

        else:#"."
            if left==-1:
                left=j
     S[i][j]=="#" S[i][j] [i] S i j "#" if left!=-1:
                for k in range(left,j,1):
                    teraseru_H[i][k] = j-left
                left=-1

         left!=-1 left -1 for k in range(left,j,1):
                    teraseru_H[i][k] = j-left
                 k range(left,j,1) range left j 1 teraseru_H[i][k] = j-left teraseru_H[i][k] [i] teraseru_H i k j-left j left left=-1 left -1 if left==-1:
                left=j
     left==-1 left -1 left=j left j if left!=-1:
        for k in range(left,W,1):
            teraseru_H[i][k] = W-left
     left!=-1 left -1 for k in range(left,W,1):
            teraseru_H[i][k] = W-left
     k range(left,W,1) range left W 1 teraseru_H[i][k] = W-left teraseru_H[i][k] [i] teraseru_H i k W-left W left left=-1 left -1 left = -1 left -1 for j in range(0,W,1):
    left=-1
    for i in range(0,H,1):
        if S[i][j]=="#":
            if left!=-1:
                for k in range(left,i,1):
                    teraseru_W[k][j] = i-left
                left=-1
        else:#"."
            if left==-1:
                left=i
    if left!=-1:
        for k in range(left,H,1):
            teraseru_W[k][j] = H-left
    left=-1 j range(0,W,1) range 0 W 1 left=-1 left -1 for i in range(0,H,1):
        if S[i][j]=="#":
            if left!=-1:
                for k in range(left,i,1):
                    teraseru_W[k][j] = i-left
                left=-1
        else:#"."
            if left==-1:
                left=i
     i range(0,H,1) range 0 H 1 if S[i][j]=="#":
            if left!=-1:
                for k in range(left,i,1):
                    teraseru_W[k][j] = i-left
                left=-1
        else:#"."
            if left==-1:
                left=i
     S[i][j]=="#" S[i][j] [i] S i j "#" if left!=-1:
                for k in range(left,i,1):
                    teraseru_W[k][j] = i-left
                left=-1
         left!=-1 left -1 for k in range(left,i,1):
                    teraseru_W[k][j] = i-left
                 k range(left,i,1) range left i 1 teraseru_W[k][j] = i-left teraseru_W[k][j] [k] teraseru_W k j i-left i left left=-1 left -1 if left==-1:
                left=i
     left==-1 left -1 left=i left i if left!=-1:
        for k in range(left,H,1):
            teraseru_W[k][j] = H-left
     left!=-1 left -1 for k in range(left,H,1):
            teraseru_W[k][j] = H-left
     k range(left,H,1) range left H 1 teraseru_W[k][j] = H-left teraseru_W[k][j] [k] teraseru_W k j H-left H left left=-1 left -1 ans = 0 ans 0 for i in range(0,H,1):
    for j in range(0,W,1):
        ans = max(ans,teraseru_H[i][j]+teraseru_W[i][j]-1) i range(0,H,1) range 0 H 1 for j in range(0,W,1):
        ans = max(ans,teraseru_H[i][j]+teraseru_W[i][j]-1) j range(0,W,1) range 0 W 1 ans = max(ans,teraseru_H[i][j]+teraseru_W[i][j]-1) ans max(ans,teraseru_H[i][j]+teraseru_W[i][j]-1) max ans teraseru_H[i][j]+teraseru_W[i][j]-1 teraseru_H[i][j]+teraseru_W[i][j] teraseru_H[i][j] [i] teraseru_H i j teraseru_W[i][j] [i] teraseru_W i j 1 print(ans) print ans teraseru_W = [[0 for i in range(0,W,1)]for j in range(0,H,1)] [[0 for i in range(0,W,1)]for j in range(0,H,1)] teraseru_W left=-1 -1 left left=i i left left=j j left teraseru_H = [[0 for i in range(0,W,1)]for j in range(0,H,1)] [[0 for i in range(0,W,1)]for j in range(0,H,1)] teraseru_H H,W = map(int,input().split()) map(int,input().split()) H left=-1 -1 left ans = 0 0 ans ans = max(ans,teraseru_H[i][j]+teraseru_W[i][j]-1) max(ans,teraseru_H[i][j]+teraseru_W[i][j]-1) ans left=-1 -1 left left = -1 -1 left S = [list(input()) for i in range(0,H,1)] [list(input()) for i in range(0,H,1)] S left=-1 -1 left left = -1 -1 left left=-1 -1 left W = map(int,input().split()) map(int,input().split()) W left=-1 -1 left
H,W = map(int,input().split())
S = [list(input()) for i in range(0,H,1)]

teraseru_H = [[0 for i in range(0,W,1)]for j in range(0,H,1)]
teraseru_W = [[0 for i in range(0,W,1)]for j in range(0,H,1)]

left = -1
for i in range(0,H,1):
    left=-1
    for j in range(0,W,1):
        if S[i][j]=="#":
            if left!=-1:
                for k in range(left,j,1):
                    teraseru_H[i][k] = j-left
                left=-1

        else:#"."
            if left==-1:
                left=j
    if left!=-1:
        for k in range(left,W,1):
            teraseru_H[i][k] = W-left
    left=-1

left = -1
for j in range(0,W,1):
    left=-1
    for i in range(0,H,1):
        if S[i][j]=="#":
            if left!=-1:
                for k in range(left,i,1):
                    teraseru_W[k][j] = i-left
                left=-1
        else:#"."
            if left==-1:
                left=i
    if left!=-1:
        for k in range(left,H,1):
            teraseru_W[k][j] = H-left
    left=-1

ans = 0

for i in range(0,H,1):
    for j in range(0,W,1):
        ans = max(ans,teraseru_H[i][j]+teraseru_W[i][j]-1)
print(ans)