#lamp
import sys
input=sys.stdin.readline
h,w=map(int,input().split())
lists=[]
for i in range(h):
    b=list(input())
    lists.append(b)
    
right=[[0 for i in range(w)] for j in range(h)]
left=[[0 for i in range(w)] for j in range(h)]
up=[[0 for i in range(w)] for j in range(h)]
down=[[0 for i in range(w)] for j in range(h)]

#rightの累積和
for i in range(h):
    for j in range(w-1,-1,-1):
        if j==w-1:
            if lists[i][j]=="#":
                right[i][j]=0
            else:
                right[i][j]=1
        else:
            if lists[i][j+1]=="#":
                if lists[i][j]=="#":
                    right[i][j]=0
                else:
                    right[i][j]=1
            elif lists[i][j+1]==".":
                if lists[i][j]=="#":
                    right[i][j]=0
                else:
                    right[i][j]=right[i][j+1]+1


#leftの累積和
for i in range(h):
    for j in range(w):
        if j==0:
            if lists[i][j]=="#":
                left[i][j]=0
            else:
                left[i][j]=1
        else:
            if lists[i][j]=="#":
                left[i][j]=0
            else:
                left[i][j]=left[i][j-1]+1


#upの累積和
for i in range(w):
    for j in range(h):
        if j==0:
            if lists[j][i]=="#":
                up[j][i]=0
            else:
                up[j][i]=1
        else:
            if lists[j][i]=="#":
                up[j][i]=0
            else:
                up[j][i]=up[j-1][i]+1

                
#downの累積和
for i in range(w):
    for j in range(h-1,-1,-1):
        if j==h-1:
            if lists[j][i]=="#":
                down[j][i]=0
            else:
                down[j][i]=1
        else:
            if lists[j][i]=="#":
                down[j][i]=0
            else:
                down[j][i]=down[j+1][i]+1
                
maxi=0
for i in range(h):
    for j in range(w):
        maxi=max(maxi,right[i][j]+left[i][j]+up[i][j]+down[i][j]-3)
print(maxi)            import sys sys input=sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline h,w=map(int,input().split()) h map(int,input().split()) map int input().split() ().split () input split w lists=[] lists [] for i in range(h):
    b=list(input())
    lists.append(b)
     i range(h) range h b=list(input()) b list(input()) list input() input lists.append(b) lists.append lists append b [0 for i in range(w)] for j in range(h) for j in range(h) j range(h) range h for j in range(h) [0 for i in range(w)] right=[[0 for i in range(w)] for j in range(h)] right [[0 for i in range(w)] for j in range(h)] [0 for i in range(w)] for j in range(h) for j in range(h) j range(h) range h for j in range(h) [0 for i in range(w)] left=[[0 for i in range(w)] for j in range(h)] left [[0 for i in range(w)] for j in range(h)] [0 for i in range(w)] for j in range(h) for j in range(h) j range(h) range h for j in range(h) [0 for i in range(w)] up=[[0 for i in range(w)] for j in range(h)] up [[0 for i in range(w)] for j in range(h)] [0 for i in range(w)] for j in range(h) for j in range(h) j range(h) range h for j in range(h) [0 for i in range(w)] down=[[0 for i in range(w)] for j in range(h)] down [[0 for i in range(w)] for j in range(h)] for i in range(h):
    for j in range(w-1,-1,-1):
        if j==w-1:
            if lists[i][j]=="#":
                right[i][j]=0
            else:
                right[i][j]=1
        else:
            if lists[i][j+1]=="#":
                if lists[i][j]=="#":
                    right[i][j]=0
                else:
                    right[i][j]=1
            elif lists[i][j+1]==".":
                if lists[i][j]=="#":
                    right[i][j]=0
                else:
                    right[i][j]=right[i][j+1]+1


#leftの累積和 i range(h) range h for j in range(w-1,-1,-1):
        if j==w-1:
            if lists[i][j]=="#":
                right[i][j]=0
            else:
                right[i][j]=1
        else:
            if lists[i][j+1]=="#":
                if lists[i][j]=="#":
                    right[i][j]=0
                else:
                    right[i][j]=1
            elif lists[i][j+1]==".":
                if lists[i][j]=="#":
                    right[i][j]=0
                else:
                    right[i][j]=right[i][j+1]+1


#leftの累積和 j range(w-1,-1,-1) range w-1 w 1 -1 -1 if j==w-1:
            if lists[i][j]=="#":
                right[i][j]=0
            else:
                right[i][j]=1
        else:
            if lists[i][j+1]=="#":
                if lists[i][j]=="#":
                    right[i][j]=0
                else:
                    right[i][j]=1
            elif lists[i][j+1]==".":
                if lists[i][j]=="#":
                    right[i][j]=0
                else:
                    right[i][j]=right[i][j+1]+1


#leftの累積和 j==w-1 j w-1 w 1 if lists[i][j]=="#":
                right[i][j]=0
            else:
                right[i][j]=1
         lists[i][j]=="#" lists[i][j] [i] lists i j "#" right[i][j]=0 right[i][j] [i] right i j 0 right[i][j]=1 right[i][j] [i] right i j 1 if lists[i][j+1]=="#":
                if lists[i][j]=="#":
                    right[i][j]=0
                else:
                    right[i][j]=1
            elif lists[i][j+1]==".":
                if lists[i][j]=="#":
                    right[i][j]=0
                else:
                    right[i][j]=right[i][j+1]+1


#leftの累積和 lists[i][j+1]=="#" lists[i][j+1] [i] lists i j+1 j 1 "#" if lists[i][j]=="#":
                    right[i][j]=0
                else:
                    right[i][j]=1
             lists[i][j]=="#" lists[i][j] [i] lists i j "#" right[i][j]=0 right[i][j] [i] right i j 0 right[i][j]=1 right[i][j] [i] right i j 1 elif lists[i][j+1]==".":
                if lists[i][j]=="#":
                    right[i][j]=0
                else:
                    right[i][j]=right[i][j+1]+1


#leftの累積和 lists[i][j+1]=="." lists[i][j+1] [i] lists i j+1 j 1 "." if lists[i][j]=="#":
                    right[i][j]=0
                else:
                    right[i][j]=right[i][j+1]+1


#leftの累積和 lists[i][j]=="#" lists[i][j] [i] lists i j "#" right[i][j]=0 right[i][j] [i] right i j 0 right[i][j]=right[i][j+1]+1 right[i][j] [i] right i j right[i][j+1]+1 right[i][j+1] [i] right i j+1 j 1 1 for i in range(h):
    for j in range(w):
        if j==0:
            if lists[i][j]=="#":
                left[i][j]=0
            else:
                left[i][j]=1
        else:
            if lists[i][j]=="#":
                left[i][j]=0
            else:
                left[i][j]=left[i][j-1]+1


#upの累積和 i range(h) range h for j in range(w):
        if j==0:
            if lists[i][j]=="#":
                left[i][j]=0
            else:
                left[i][j]=1
        else:
            if lists[i][j]=="#":
                left[i][j]=0
            else:
                left[i][j]=left[i][j-1]+1


#upの累積和 j range(w) range w if j==0:
            if lists[i][j]=="#":
                left[i][j]=0
            else:
                left[i][j]=1
        else:
            if lists[i][j]=="#":
                left[i][j]=0
            else:
                left[i][j]=left[i][j-1]+1


#upの累積和 j==0 j 0 if lists[i][j]=="#":
                left[i][j]=0
            else:
                left[i][j]=1
         lists[i][j]=="#" lists[i][j] [i] lists i j "#" left[i][j]=0 left[i][j] [i] left i j 0 left[i][j]=1 left[i][j] [i] left i j 1 if lists[i][j]=="#":
                left[i][j]=0
            else:
                left[i][j]=left[i][j-1]+1


#upの累積和 lists[i][j]=="#" lists[i][j] [i] lists i j "#" left[i][j]=0 left[i][j] [i] left i j 0 left[i][j]=left[i][j-1]+1 left[i][j] [i] left i j left[i][j-1]+1 left[i][j-1] [i] left i j-1 j 1 1 for i in range(w):
    for j in range(h):
        if j==0:
            if lists[j][i]=="#":
                up[j][i]=0
            else:
                up[j][i]=1
        else:
            if lists[j][i]=="#":
                up[j][i]=0
            else:
                up[j][i]=up[j-1][i]+1

                
#downの累積和 i range(w) range w for j in range(h):
        if j==0:
            if lists[j][i]=="#":
                up[j][i]=0
            else:
                up[j][i]=1
        else:
            if lists[j][i]=="#":
                up[j][i]=0
            else:
                up[j][i]=up[j-1][i]+1

                
#downの累積和 j range(h) range h if j==0:
            if lists[j][i]=="#":
                up[j][i]=0
            else:
                up[j][i]=1
        else:
            if lists[j][i]=="#":
                up[j][i]=0
            else:
                up[j][i]=up[j-1][i]+1

                
#downの累積和 j==0 j 0 if lists[j][i]=="#":
                up[j][i]=0
            else:
                up[j][i]=1
         lists[j][i]=="#" lists[j][i] [j] lists j i "#" up[j][i]=0 up[j][i] [j] up j i 0 up[j][i]=1 up[j][i] [j] up j i 1 if lists[j][i]=="#":
                up[j][i]=0
            else:
                up[j][i]=up[j-1][i]+1

                
#downの累積和 lists[j][i]=="#" lists[j][i] [j] lists j i "#" up[j][i]=0 up[j][i] [j] up j i 0 up[j][i]=up[j-1][i]+1 up[j][i] [j] up j i up[j-1][i]+1 up[j-1][i] [j-1] up j-1 j 1 i 1 for i in range(w):
    for j in range(h-1,-1,-1):
        if j==h-1:
            if lists[j][i]=="#":
                down[j][i]=0
            else:
                down[j][i]=1
        else:
            if lists[j][i]=="#":
                down[j][i]=0
            else:
                down[j][i]=down[j+1][i]+1
                 i range(w) range w for j in range(h-1,-1,-1):
        if j==h-1:
            if lists[j][i]=="#":
                down[j][i]=0
            else:
                down[j][i]=1
        else:
            if lists[j][i]=="#":
                down[j][i]=0
            else:
                down[j][i]=down[j+1][i]+1
                 j range(h-1,-1,-1) range h-1 h 1 -1 -1 if j==h-1:
            if lists[j][i]=="#":
                down[j][i]=0
            else:
                down[j][i]=1
        else:
            if lists[j][i]=="#":
                down[j][i]=0
            else:
                down[j][i]=down[j+1][i]+1
                 j==h-1 j h-1 h 1 if lists[j][i]=="#":
                down[j][i]=0
            else:
                down[j][i]=1
         lists[j][i]=="#" lists[j][i] [j] lists j i "#" down[j][i]=0 down[j][i] [j] down j i 0 down[j][i]=1 down[j][i] [j] down j i 1 if lists[j][i]=="#":
                down[j][i]=0
            else:
                down[j][i]=down[j+1][i]+1
                 lists[j][i]=="#" lists[j][i] [j] lists j i "#" down[j][i]=0 down[j][i] [j] down j i 0 down[j][i]=down[j+1][i]+1 down[j][i] [j] down j i down[j+1][i]+1 down[j+1][i] [j+1] down j+1 j 1 i 1 maxi=0 maxi 0 for i in range(h):
    for j in range(w):
        maxi=max(maxi,right[i][j]+left[i][j]+up[i][j]+down[i][j]-3) i range(h) range h for j in range(w):
        maxi=max(maxi,right[i][j]+left[i][j]+up[i][j]+down[i][j]-3) j range(w) range w maxi=max(maxi,right[i][j]+left[i][j]+up[i][j]+down[i][j]-3) maxi max(maxi,right[i][j]+left[i][j]+up[i][j]+down[i][j]-3) max maxi right[i][j]+left[i][j]+up[i][j]+down[i][j]-3 right[i][j]+left[i][j]+up[i][j]+down[i][j] right[i][j]+left[i][j]+up[i][j] right[i][j]+left[i][j] right[i][j] [i] right i j left[i][j] [i] left i j up[i][j] [i] up i j down[i][j] [i] down i j 3 print(maxi) print maxi w=map(int,input().split()) map(int,input().split()) w right=[[0 for i in range(w)] for j in range(h)] [[0 for i in range(w)] for j in range(h)] right h,w=map(int,input().split()) map(int,input().split()) h down=[[0 for i in range(w)] for j in range(h)] [[0 for i in range(w)] for j in range(h)] down lists=[] [] lists maxi=0 0 maxi input=sys.stdin.readline sys.stdin.readline input up=[[0 for i in range(w)] for j in range(h)] [[0 for i in range(w)] for j in range(h)] up b=list(input()) list(input()) b left=[[0 for i in range(w)] for j in range(h)] [[0 for i in range(w)] for j in range(h)] left maxi=max(maxi,right[i][j]+left[i][j]+up[i][j]+down[i][j]-3) max(maxi,right[i][j]+left[i][j]+up[i][j]+down[i][j]-3) maxi
#lamp
import sys
input=sys.stdin.readline
h,w=map(int,input().split())
lists=[]
for i in range(h):
    b=list(input())
    lists.append(b)
    
right=[[0 for i in range(w)] for j in range(h)]
left=[[0 for i in range(w)] for j in range(h)]
up=[[0 for i in range(w)] for j in range(h)]
down=[[0 for i in range(w)] for j in range(h)]

#rightの累積和
for i in range(h):
    for j in range(w-1,-1,-1):
        if j==w-1:
            if lists[i][j]=="#":
                right[i][j]=0
            else:
                right[i][j]=1
        else:
            if lists[i][j+1]=="#":
                if lists[i][j]=="#":
                    right[i][j]=0
                else:
                    right[i][j]=1
            elif lists[i][j+1]==".":
                if lists[i][j]=="#":
                    right[i][j]=0
                else:
                    right[i][j]=right[i][j+1]+1


#leftの累積和
for i in range(h):
    for j in range(w):
        if j==0:
            if lists[i][j]=="#":
                left[i][j]=0
            else:
                left[i][j]=1
        else:
            if lists[i][j]=="#":
                left[i][j]=0
            else:
                left[i][j]=left[i][j-1]+1


#upの累積和
for i in range(w):
    for j in range(h):
        if j==0:
            if lists[j][i]=="#":
                up[j][i]=0
            else:
                up[j][i]=1
        else:
            if lists[j][i]=="#":
                up[j][i]=0
            else:
                up[j][i]=up[j-1][i]+1

                
#downの累積和
for i in range(w):
    for j in range(h-1,-1,-1):
        if j==h-1:
            if lists[j][i]=="#":
                down[j][i]=0
            else:
                down[j][i]=1
        else:
            if lists[j][i]=="#":
                down[j][i]=0
            else:
                down[j][i]=down[j+1][i]+1
                
maxi=0
for i in range(h):
    for j in range(w):
        maxi=max(maxi,right[i][j]+left[i][j]+up[i][j]+down[i][j]-3)
print(maxi)           
