# -*- coding: utf-8 -*-

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



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

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

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

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

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



for i in range(h):

    for j in range(w):

        l[i][j] = 0 if s[i][j] == '#' else 1 + (0 if j == 0 else l[i][j - 1])

    for j in range(w - 1, -1, -1):

        r[i][j] = 0 if s[i][j] == '#' else 1 + (0 if j == w - 1 else r[i][j + 1])



for j in range(w):

    for i in range(h):

        u[i][j] = 0 if s[i][j] == '#' else 1 + (0 if i == 0 else u[i - 1][j])

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

        d[i][j] = 0 if s[i][j] == '#' else 1 + (0 if i == h - 1 else d[i + 1][j])



ans = 0

for i in range(h):

    for j in range(w):

        ans = max(ans, l[i][j] + r[i][j] + u[i][j] + d[i][j] - 3)

print(ans)
# -*- coding: utf-8 -*-

import numpy as np



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



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

b = np.array(s)

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



u = np.zeros((h, w), dtype=np.int)

for i in range(1, h):

    u[i] += (u[i - 1] + 1) * b[i - 1]



d = np.zeros((h, w), dtype=np.int)

for i in range(h - 2, -1, -1):

    d[i] += (d[i + 1] + 1) * b[i + 1]



l = np.zeros((h, w), dtype=np.int)

for j in range(1, w):

    l[:, j] += (l[:, j - 1] + 1) * b[:, j - 1]



r = np.zeros((h, w), dtype=np.int)

for j in range(w - 2, -1, -1):

    r[:, j] += (r[:, j + 1] + 1) * b[:, j + 1]



print((((u + d + l + r) * b).max() + 1))
# -*- coding: utf-8 -*-
h, w = list(map(int, input().split()))
s = [eval(input()) for i in range(h)]
l = [[0 for j in range(w)] for i in range(h)]
r = [[0 for j in range(w)] for i in range(h)]
u = [[0 for j in range(w)] for i in range(h)]
d = [[0 for j in range(w)] for i in range(h)]
for i in range(h):
    for j in range(w):
        l[i][j] = 0 if s[i][j] == "#" else 1 + (0 if j == 0 else l[i][j - 1])
    for j in range(w - 1, -1, -1):
        r[i][j] = 0 if s[i][j] == "#" else 1 + (0 if j == w - 1 else r[i][j + 1])
for j in range(w):
    for i in range(h):
        u[i][j] = 0 if s[i][j] == "#" else 1 + (0 if i == 0 else u[i - 1][j])
    for i in range(h - 1, -1, -1):
        d[i][j] = 0 if s[i][j] == "#" else 1 + (0 if i == h - 1 else d[i + 1][j])
ans = 0
for i in range(h):
    for j in range(w):
        ans = max(ans, l[i][j] + r[i][j] + u[i][j] + d[i][j] - 3)
print(ans)

# -*- coding: utf-8 -*-
import numpy as np

h, w = list(map(int, input().split()))
s = [list(eval(input())) for i in range(h)]
b = np.array(s)
b = np.where(b == ".", 1, 0)
u = np.zeros((h, w), dtype=np.int)
for i in range(1, h):
    u[i] += (u[i - 1] + 1) * b[i - 1]
d = np.zeros((h, w), dtype=np.int)
for i in range(h - 2, -1, -1):
    d[i] += (d[i + 1] + 1) * b[i + 1]
l = np.zeros((h, w), dtype=np.int)
for j in range(1, w):
    l[:, j] += (l[:, j - 1] + 1) * b[:, j - 1]
r = np.zeros((h, w), dtype=np.int)
for j in range(w - 2, -1, -1):
    r[:, j] += (r[:, j + 1] + 1) * b[:, j + 1]
print((((u + d + l + r) * b).max() + 1))

+import numpy as np + -s = [eval(input()) for i in range(h)] -l = [[0 for j in range(w)] for i in range(h)] -r = [[0 for j in range(w)] for i in range(h)] -u = [[0 for j in range(w)] for i in range(h)] -d = [[0 for j in range(w)] for i in range(h)] -for i in range(h): -    for j in range(w): -        l[i][j] = 0 if s[i][j] == "#" else 1 + (0 if j == 0 else l[i][j - 1]) -    for j in range(w - 1, -1, -1): -        r[i][j] = 0 if s[i][j] == "#" else 1 + (0 if j == w - 1 else r[i][j + 1]) -for j in range(w): -    for i in range(h): -        u[i][j] = 0 if s[i][j] == "#" else 1 + (0 if i == 0 else u[i - 1][j]) -    for i in range(h - 1, -1, -1): -        d[i][j] = 0 if s[i][j] == "#" else 1 + (0 if i == h - 1 else d[i + 1][j]) -ans = 0 -for i in range(h): -    for j in range(w): -        ans = max(ans, l[i][j] + r[i][j] + u[i][j] + d[i][j] - 3) -print(ans) +s = [list(eval(input())) for i in range(h)] +b = np.array(s) +b = np.where(b == ".", 1, 0) +u = np.zeros((h, w), dtype=np.int) +for i in range(1, h): +    u[i] += (u[i - 1] + 1) * b[i - 1] +d = np.zeros((h, w), dtype=np.int) +for i in range(h - 2, -1, -1): +    d[i] += (d[i + 1] + 1) * b[i + 1] +l = np.zeros((h, w), dtype=np.int) +for j in range(1, w): +    l[:, j] += (l[:, j - 1] + 1) * b[:, j - 1] +r = np.zeros((h, w), dtype=np.int) +for j in range(w - 2, -1, -1): +    r[:, j] += (r[:, j + 1] + 1) * b[:, j + 1] +print((((u + d + l + r) * b).max() + 1))