import sys



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

grids = [[s for s in sys.stdin.readline()] for _ in range(H)]



col_cnt = [[0 for _ in range(W)]for _ in range(H)]

for i in range(W):

  tmp_cnt = 0

  prvjj = 0

  for j in range(H):

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

      tmp_cnt += 1

    else:

      col_cnt[j][i] = 0

      for jj in range(prvjj,j):

        col_cnt[jj][i] = tmp_cnt

      prvjj = j+1

      tmp_cnt = 0

  for jj in range(prvjj,H):

    col_cnt[jj][i] = tmp_cnt



ans = -float('inf')

for j in range(H):

  tmp_cnt = 0

  prvii = 0

  for i in range(W):

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

      tmp_cnt += 1

    else:

      for ii in range(prvii,i):

        ans = max(ans,col_cnt[j][ii]+tmp_cnt-1)

      prvii = i+1

      tmp_cnt = 0



  for ii in range(prvii,W):

    ans = max(ans,col_cnt[j][ii]+tmp_cnt-1)



print(ans)
import copy





def make_empty_nums():

    under_empty_nums = [[0 for _ in range(W)] for _ in range(H)]



    for h in range(H - 1, -1, -1):

        for w in range(W):

            if grids[h][w] == '#':

                under_empty_nums[h][w] = 0

            else:

                if h == H - 1:

                    under_empty_nums[h][w] = 1

                else:

                    under_empty_nums[h][w] = under_empty_nums[h + 1][w] + 1



    empty_nums = copy.copy(under_empty_nums)

    for h in range(1, H):

        for w in range(W):

            if empty_nums[h][w] != 0:

                empty_nums[h][w] = max(empty_nums[h][w], empty_nums[h-1][w])



    return empty_nums





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

grids = [eval(input()) for _ in range(H)]

empty_nums = make_empty_nums()

ans = 0

for h in range(H):

    max_lighted_grids = 0

    tmp_max_lighted_grids = [0, 0]

    for w in range(W):

        if empty_nums[h][w] == 0:

            max_lighted_grids = max(max_lighted_grids, sum(tmp_max_lighted_grids) - 1)

            tmp_max_lighted_grids = [0, 0]

        else:

            tmp_max_lighted_grids[0] = max(tmp_max_lighted_grids[0], empty_nums[h][w])

            tmp_max_lighted_grids[1] += 1

            if w == W-1:

                max_lighted_grids = max(max_lighted_grids, sum(tmp_max_lighted_grids) - 1)

    ans = max(ans, max_lighted_grids)

print(ans)
import sys

H, W = list(map(int, input().split()))
grids = [[s for s in sys.stdin.readline()] for _ in range(H)]
col_cnt = [[0 for _ in range(W)] for _ in range(H)]
for i in range(W):
    tmp_cnt = 0
    prvjj = 0
    for j in range(H):
        if grids[j][i] == ".":
            tmp_cnt += 1
        else:
            col_cnt[j][i] = 0
            for jj in range(prvjj, j):
                col_cnt[jj][i] = tmp_cnt
            prvjj = j + 1
            tmp_cnt = 0
    for jj in range(prvjj, H):
        col_cnt[jj][i] = tmp_cnt
ans = -float("inf")
for j in range(H):
    tmp_cnt = 0
    prvii = 0
    for i in range(W):
        if grids[j][i] == ".":
            tmp_cnt += 1
        else:
            for ii in range(prvii, i):
                ans = max(ans, col_cnt[j][ii] + tmp_cnt - 1)
            prvii = i + 1
            tmp_cnt = 0
    for ii in range(prvii, W):
        ans = max(ans, col_cnt[j][ii] + tmp_cnt - 1)
print(ans)

import copy


def make_empty_nums():
    under_empty_nums = [[0 for _ in range(W)] for _ in range(H)]
    for h in range(H - 1, -1, -1):
        for w in range(W):
            if grids[h][w] == "#":
                under_empty_nums[h][w] = 0
            else:
                if h == H - 1:
                    under_empty_nums[h][w] = 1
                else:
                    under_empty_nums[h][w] = under_empty_nums[h + 1][w] + 1
    empty_nums = copy.copy(under_empty_nums)
    for h in range(1, H):
        for w in range(W):
            if empty_nums[h][w] != 0:
                empty_nums[h][w] = max(empty_nums[h][w], empty_nums[h - 1][w])
    return empty_nums


H, W = list(map(int, input().split()))
grids = [eval(input()) for _ in range(H)]
empty_nums = make_empty_nums()
ans = 0
for h in range(H):
    max_lighted_grids = 0
    tmp_max_lighted_grids = [0, 0]
    for w in range(W):
        if empty_nums[h][w] == 0:
            max_lighted_grids = max(max_lighted_grids, sum(tmp_max_lighted_grids) - 1)
            tmp_max_lighted_grids = [0, 0]
        else:
            tmp_max_lighted_grids[0] = max(tmp_max_lighted_grids[0], empty_nums[h][w])
            tmp_max_lighted_grids[1] += 1
            if w == W - 1:
                max_lighted_grids = max(
                    max_lighted_grids, sum(tmp_max_lighted_grids) - 1
                )
    ans = max(ans, max_lighted_grids)
print(ans)

-import sys +import copy + + +def make_empty_nums(): +    under_empty_nums = [[0 for _ in range(W)] for _ in range(H)] +    for h in range(H - 1, -1, -1): +        for w in range(W): +            if grids[h][w] == "#": +                under_empty_nums[h][w] = 0 +            else: +                if h == H - 1: +                    under_empty_nums[h][w] = 1 +                else: +                    under_empty_nums[h][w] = under_empty_nums[h + 1][w] + 1 +    empty_nums = copy.copy(under_empty_nums) +    for h in range(1, H): +        for w in range(W): +            if empty_nums[h][w] != 0: +                empty_nums[h][w] = max(empty_nums[h][w], empty_nums[h - 1][w]) +    return empty_nums + -grids = [[s for s in sys.stdin.readline()] for _ in range(H)] -col_cnt = [[0 for _ in range(W)] for _ in range(H)] -for i in range(W): -    tmp_cnt = 0 -    prvjj = 0 -    for j in range(H): -        if grids[j][i] == ".": -            tmp_cnt += 1 +grids = [eval(input()) for _ in range(H)] +empty_nums = make_empty_nums() +ans = 0 +for h in range(H): +    max_lighted_grids = 0 +    tmp_max_lighted_grids = [0, 0] +    for w in range(W): +        if empty_nums[h][w] == 0: +            max_lighted_grids = max(max_lighted_grids, sum(tmp_max_lighted_grids) - 1) +            tmp_max_lighted_grids = [0, 0] -            col_cnt[j][i] = 0 -            for jj in range(prvjj, j): -                col_cnt[jj][i] = tmp_cnt -            prvjj = j + 1 -            tmp_cnt = 0 -    for jj in range(prvjj, H): -        col_cnt[jj][i] = tmp_cnt -ans = -float("inf") -for j in range(H): -    tmp_cnt = 0 -    prvii = 0 -    for i in range(W): -        if grids[j][i] == ".": -            tmp_cnt += 1 -        else: -            for ii in range(prvii, i): -                ans = max(ans, col_cnt[j][ii] + tmp_cnt - 1) -            prvii = i + 1 -            tmp_cnt = 0 -    for ii in range(prvii, W): -        ans = max(ans, col_cnt[j][ii] + tmp_cnt - 1) +            tmp_max_lighted_grids[0] = max(tmp_max_lighted_grids[0], empty_nums[h][w]) +            tmp_max_lighted_grids[1] += 1 +            if w == W - 1: +                max_lighted_grids = max( +                    max_lighted_grids, sum(tmp_max_lighted_grids) - 1 +                ) +    ans = max(ans, max_lighted_grids)