import numpy as np


H, W = map(int, input().split())
field = [[c == "." for c in input()] for _ in range(H)]
field = np.array(field, dtype=np.int16)

u = field.copy()
d = field.copy()
l = field.copy()
r = field.copy()

for i in range(1, H):
    u[i] = (u[i - 1] + 1) * u[i]
    d[-i - 1] = (d[-i] + 1) * d[-i - 1]

for j in range(1, W):
    l[:, j] = (l[:, j - 1] + 1) * l[:, j]
    r[:, -j - 1] = (r[:, -j] + 1) * r[:, -j - 1]

print((u + d + l + r - 3).max()) import numpy as np numpy H, W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W [c == "." for c in input()] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [c == "." for c in input()] field = [[c == "." for c in input()] for _ in range(H)] field [[c == "." for c in input()] for _ in range(H)] field = np.array(field, dtype=np.int16) field np.array(field, dtype=np.int16) np.array np array field dtype=np.int16 dtype np.int16 np int16 u = field.copy() u field.copy() field.copy field copy d = field.copy() d field.copy() field.copy field copy l = field.copy() l field.copy() field.copy field copy r = field.copy() r field.copy() field.copy field copy for i in range(1, H):
    u[i] = (u[i - 1] + 1) * u[i]
    d[-i - 1] = (d[-i] + 1) * d[-i - 1] i range(1, H) range 1 H u[i] = (u[i - 1] + 1) * u[i] u[i] u i (u[i - 1] + 1) * u[i] u[i - 1] + 1 u[i - 1] u i - 1 i 1 1 u[i] u i d[-i - 1] = (d[-i] + 1) * d[-i - 1] d[-i - 1] d -i - 1 -i i 1 (d[-i] + 1) * d[-i - 1] d[-i] + 1 d[-i] d -i i 1 d[-i - 1] d -i - 1 -i i 1 for j in range(1, W):
    l[:, j] = (l[:, j - 1] + 1) * l[:, j]
    r[:, -j - 1] = (r[:, -j] + 1) * r[:, -j - 1] j range(1, W) range 1 W l[:, j] = (l[:, j - 1] + 1) * l[:, j] l[:, j] l : (l[:, j - 1] + 1) * l[:, j] l[:, j - 1] + 1 l[:, j - 1] l : 1 l[:, j] l : r[:, -j - 1] = (r[:, -j] + 1) * r[:, -j - 1] r[:, -j - 1] r : (r[:, -j] + 1) * r[:, -j - 1] r[:, -j] + 1 r[:, -j] r : 1 r[:, -j - 1] r : print((u + d + l + r - 3).max()) print (u + d + l + r - 3).max() u + d + l + r - 3).max u + d + l + r - 3 u + d + l + r u + d + l u + d u d l r 3 max u = field.copy() field.copy() u H, W = map(int, input().split()) map(int, input().split()) H l = field.copy() field.copy() l d = field.copy() field.copy() d W = map(int, input().split()) map(int, input().split()) W r = field.copy() field.copy() r field = [[c == "." for c in input()] for _ in range(H)] [[c == "." for c in input()] for _ in range(H)] field field = np.array(field, dtype=np.int16) np.array(field, dtype=np.int16) field
import numpy as np


H, W = map(int, input().split())
field = [[c == "." for c in input()] for _ in range(H)]
field = np.array(field, dtype=np.int16)

u = field.copy()
d = field.copy()
l = field.copy()
r = field.copy()

for i in range(1, H):
    u[i] = (u[i - 1] + 1) * u[i]
    d[-i - 1] = (d[-i] + 1) * d[-i - 1]

for j in range(1, W):
    l[:, j] = (l[:, j - 1] + 1) * l[:, j]
    r[:, -j - 1] = (r[:, -j] + 1) * r[:, -j - 1]

print((u + d + l + r - 3).max())
