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

grid=[list(eval(input())) for i in range(h)]



left=[[0]*w for _ in range(h)]

for i in range(h):

  cnt=0

  for j in range(w):

    if grid[i][j]=='.':

      cnt+=1

      left[i][j]=cnt

    else:

      cnt=0

      left[i][j]=cnt

      

right=[[0]*w for _ in range(h)]

for i in range(h):

  cnt=0

  for j in range(w):

    if grid[i][w-j-1]=='.':

      cnt+=1

      right[i][j]=cnt

    else:

      cnt=0

      right[i][j]=cnt



up=[[0]*w for i in range(h)]

for i in range(w):

  cnt=0

  for j in range(h):

    if grid[j][i]=='.':

        cnt+=1

        up[j][i]=cnt

    else:

        cnt=0

        up[j][i]=cnt



down=[[0]*w for i in range(h)]

for i in range(w):

  cnt=0

  for j in range(h):

    if grid[h-j-1][i]=='.':

        cnt+=1

        down[j][i]=cnt

    else:

        cnt=0

        down[j][i]=cnt



ans=0

for i in range(h):

  for j in range(w):

    if grid[i][j]=='.':

      tmp=left[i][j]+right[i][w-j-1]+up[i][j]+down[h-i-1][j]-3

      if tmp>ans:

        ans=tmp

    else:

      continue

print(ans)

    
def main(): 

  import numpy as np 

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

  grid=np.array([list(eval(input())) for i in range(h)])

  grid=np.where(grid=='.',1,0)

    

  left=np.zeros((h,w),dtype=np.int64)

  right=np.zeros((h,w),dtype=np.int64)

  up=np.zeros((h,w),dtype=np.int64)

  down=np.zeros((h,w),dtype=np.int64)

  

  for i in range(w):

    left[:,i]=(left[:,i-1]+1)*grid[:,i]

    right[:,-i-1]=(right[:,-i]+1)*grid[:,-i-1]

  for i in range(h):

    up[i]=(up[i-1]+1)*grid[i]

    down[-i-1]=(down[-i]+1)*grid[-i-1]

  

  print((np.max(left+right+up+down)-3))

  

if __name__=='__main__':

  main()
h, w = list(map(int, input().split()))
grid = [list(eval(input())) for i in range(h)]
left = [[0] * w for _ in range(h)]
for i in range(h):
    cnt = 0
    for j in range(w):
        if grid[i][j] == ".":
            cnt += 1
            left[i][j] = cnt
        else:
            cnt = 0
            left[i][j] = cnt
right = [[0] * w for _ in range(h)]
for i in range(h):
    cnt = 0
    for j in range(w):
        if grid[i][w - j - 1] == ".":
            cnt += 1
            right[i][j] = cnt
        else:
            cnt = 0
            right[i][j] = cnt
up = [[0] * w for i in range(h)]
for i in range(w):
    cnt = 0
    for j in range(h):
        if grid[j][i] == ".":
            cnt += 1
            up[j][i] = cnt
        else:
            cnt = 0
            up[j][i] = cnt
down = [[0] * w for i in range(h)]
for i in range(w):
    cnt = 0
    for j in range(h):
        if grid[h - j - 1][i] == ".":
            cnt += 1
            down[j][i] = cnt
        else:
            cnt = 0
            down[j][i] = cnt
ans = 0
for i in range(h):
    for j in range(w):
        if grid[i][j] == ".":
            tmp = left[i][j] + right[i][w - j - 1] + up[i][j] + down[h - i - 1][j] - 3
            if tmp > ans:
                ans = tmp
        else:
            continue
print(ans)

def main():
    import numpy as np

    h, w = list(map(int, input().split()))
    grid = np.array([list(eval(input())) for i in range(h)])
    grid = np.where(grid == ".", 1, 0)
    left = np.zeros((h, w), dtype=np.int64)
    right = np.zeros((h, w), dtype=np.int64)
    up = np.zeros((h, w), dtype=np.int64)
    down = np.zeros((h, w), dtype=np.int64)
    for i in range(w):
        left[:, i] = (left[:, i - 1] + 1) * grid[:, i]
        right[:, -i - 1] = (right[:, -i] + 1) * grid[:, -i - 1]
    for i in range(h):
        up[i] = (up[i - 1] + 1) * grid[i]
        down[-i - 1] = (down[-i] + 1) * grid[-i - 1]
    print((np.max(left + right + up + down) - 3))


if __name__ == "__main__":
    main()

-h, w = list(map(int, input().split())) -grid = [list(eval(input())) for i in range(h)] -left = [[0] * w for _ in range(h)] -for i in range(h): -    cnt = 0 -    for j in range(w): -        if grid[i][j] == ".": -            cnt += 1 -            left[i][j] = cnt -        else: -            cnt = 0 -            left[i][j] = cnt -right = [[0] * w for _ in range(h)] -for i in range(h): -    cnt = 0 -    for j in range(w): -        if grid[i][w - j - 1] == ".": -            cnt += 1 -            right[i][j] = cnt -        else: -            cnt = 0 -            right[i][j] = cnt -up = [[0] * w for i in range(h)] -for i in range(w): -    cnt = 0 -    for j in range(h): -        if grid[j][i] == ".": -            cnt += 1 -            up[j][i] = cnt -        else: -            cnt = 0 -            up[j][i] = cnt -down = [[0] * w for i in range(h)] -for i in range(w): -    cnt = 0 -    for j in range(h): -        if grid[h - j - 1][i] == ".": -            cnt += 1 -            down[j][i] = cnt -        else: -            cnt = 0 -            down[j][i] = cnt -ans = 0 -for i in range(h): -    for j in range(w): -        if grid[i][j] == ".": -            tmp = left[i][j] + right[i][w - j - 1] + up[i][j] + down[h - i - 1][j] - 3 -            if tmp > ans: -                ans = tmp -        else: -            continue -print(ans) +def main(): +    import numpy as np + +    h, w = list(map(int, input().split())) +    grid = np.array([list(eval(input())) for i in range(h)]) +    grid = np.where(grid == ".", 1, 0) +    left = np.zeros((h, w), dtype=np.int64) +    right = np.zeros((h, w), dtype=np.int64) +    up = np.zeros((h, w), dtype=np.int64) +    down = np.zeros((h, w), dtype=np.int64) +    for i in range(w): +        left[:, i] = (left[:, i - 1] + 1) * grid[:, i] +        right[:, -i - 1] = (right[:, -i] + 1) * grid[:, -i - 1] +    for i in range(h): +        up[i] = (up[i - 1] + 1) * grid[i] +        down[-i - 1] = (down[-i] + 1) * grid[-i - 1] +    print((np.max(left + right + up + down) - 3)) + + +if __name__ == "__main__": +    main()