import sys

from bisect import bisect_left

sys.setrecursionlimit(10**7)

def lmi(): return list(map(int, input().split()))



h, w = lmi()

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



a = [[] for i in range(h)]

#al = [[] for i in range(h)]

b = [[] for i in range(w)]

bl = [[] for i in range(w)]

for i in range(h):

    k = 0

    for j in range(w):

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

            k += 1

            if j == w-1:

                a[i].append(k)

                #al[i].append(j)

        elif j != 0 and s[i][j-1] == '.':

            a[i].append(k)

            #al[i].append(j-1)

            k = 0



for i in range(w):

    k = 0

    for j in range(h):

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

            k += 1

            if j == h-1:

                b[i].append(k)

                bl[i].append(j)

        elif j != 0 and s[j-1][i] == '.':

            b[i].append(k)

            bl[i].append(j-1)

            k = 0

'''

print(a)

print(al)

print(b)

print(bl)

'''



ans = 0

for i in range(h):

    k = 0

    c = -1

    for j in range(w):

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

            c = a[i][k]

            d = b[j][bisect_left(bl[j], i)]

            #print(c,d)

            ans = max(ans, c+d-1)

        elif j != 0 and s[i][j-1] == '.' and c != -1:

                k += 1

print(ans)

from bisect import bisect_left

def lmi(): return list(map(int, input().split()))



h, w = lmi()

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



cnt = [[0 for i in range(w)] for j in range(h)]

for i in range(h):

    j = 0

    while j < w:

        if s[i][j] == '#':

            j += 1

            continue

        l = 0

        while j+l < w:

            if s[i][j+l] == '#':

                break

            l += 1

        for k in range(l):

            cnt[i][j+k] += l

        j += l+1



for i in range(w):

    j = 0

    while j < h:

        if s[j][i] == '#':

            j += 1

            continue

        l = 0

        while j+l < h:

            if s[j+l][i] == '#':

                break

            l += 1

        for k in range(l):

            cnt[j+k][i] += l

        j += l+1





print((max([max([cnt[i][j] for i in range(h)]) for j in range(w)])-1))

import sys
from bisect import bisect_left

sys.setrecursionlimit(10**7)


def lmi():
    return list(map(int, input().split()))


h, w = lmi()
s = [eval(input()) for i in range(h)]
a = [[] for i in range(h)]
# al = [[] for i in range(h)]
b = [[] for i in range(w)]
bl = [[] for i in range(w)]
for i in range(h):
    k = 0
    for j in range(w):
        if s[i][j] == ".":
            k += 1
            if j == w - 1:
                a[i].append(k)
                # al[i].append(j)
        elif j != 0 and s[i][j - 1] == ".":
            a[i].append(k)
            # al[i].append(j-1)
            k = 0
for i in range(w):
    k = 0
    for j in range(h):
        if s[j][i] == ".":
            k += 1
            if j == h - 1:
                b[i].append(k)
                bl[i].append(j)
        elif j != 0 and s[j - 1][i] == ".":
            b[i].append(k)
            bl[i].append(j - 1)
            k = 0
"""
print(a)
print(al)
print(b)
print(bl)
"""
ans = 0
for i in range(h):
    k = 0
    c = -1
    for j in range(w):
        if s[i][j] == ".":
            c = a[i][k]
            d = b[j][bisect_left(bl[j], i)]
            # print(c,d)
            ans = max(ans, c + d - 1)
        elif j != 0 and s[i][j - 1] == "." and c != -1:
            k += 1
print(ans)

from bisect import bisect_left


def lmi():
    return list(map(int, input().split()))


h, w = lmi()
s = [eval(input()) for i in range(h)]
cnt = [[0 for i in range(w)] for j in range(h)]
for i in range(h):
    j = 0
    while j < w:
        if s[i][j] == "#":
            j += 1
            continue
        l = 0
        while j + l < w:
            if s[i][j + l] == "#":
                break
            l += 1
        for k in range(l):
            cnt[i][j + k] += l
        j += l + 1
for i in range(w):
    j = 0
    while j < h:
        if s[j][i] == "#":
            j += 1
            continue
        l = 0
        while j + l < h:
            if s[j + l][i] == "#":
                break
            l += 1
        for k in range(l):
            cnt[j + k][i] += l
        j += l + 1
print((max([max([cnt[i][j] for i in range(h)]) for j in range(w)]) - 1))

-import sys - -sys.setrecursionlimit(10**7) -a = [[] for i in range(h)] -# al = [[] for i in range(h)] -b = [[] for i in range(w)] -bl = [[] for i in range(w)] +cnt = [[0 for i in range(w)] for j in range(h)] -    k = 0 -    for j in range(w): -        if s[i][j] == ".": -            k += 1 -            if j == w - 1: -                a[i].append(k) -                # al[i].append(j) -        elif j != 0 and s[i][j - 1] == ".": -            a[i].append(k) -            # al[i].append(j-1) -            k = 0 +    j = 0 +    while j < w: +        if s[i][j] == "#": +            j += 1 +            continue +        l = 0 +        while j + l < w: +            if s[i][j + l] == "#": +                break +            l += 1 +        for k in range(l): +            cnt[i][j + k] += l +        j += l + 1 -    k = 0 -    for j in range(h): -        if s[j][i] == ".": -            k += 1 -            if j == h - 1: -                b[i].append(k) -                bl[i].append(j) -        elif j != 0 and s[j - 1][i] == ".": -            b[i].append(k) -            bl[i].append(j - 1) -            k = 0 -""" -print(a) -print(al) -print(b) -print(bl) -""" -ans = 0 -for i in range(h): -    k = 0 -    c = -1 -    for j in range(w): -        if s[i][j] == ".": -            c = a[i][k] -            d = b[j][bisect_left(bl[j], i)] -            # print(c,d) -            ans = max(ans, c + d - 1) -        elif j != 0 and s[i][j - 1] == "." and c != -1: -            k += 1 -print(ans) +    j = 0 +    while j < h: +        if s[j][i] == "#": +            j += 1 +            continue +        l = 0 +        while j + l < h: +            if s[j + l][i] == "#": +                break +            l += 1 +        for k in range(l): +            cnt[j + k][i] += l +        j += l + 1 +print((max([max([cnt[i][j] for i in range(h)]) for j in range(w)]) - 1))