import numpy as np
h, w = map(int, input().split())
s = [list(input()) for i in range(h)]
li = [[0 if s[i][j] == "#" else 1 for j in range(w)] for i in range(h)]
l, r, u, d = np.array(li), np.array(li), np.array(li), np.array(li)
for i in range(1, h):
    u[i] *= (u[i - 1] + 1)
    d[-i - 1] *= (d[-i] + 1)
for i in range(1, w):
    l[:, i] *= (l[:, i - 1] + 1)
    r[:, -i - 1] *= (r[:, -i] + 1)
print((l + r + u + d - 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 list(input()) for i in range(h) for i in range(h) i range(h) range h for i in range(h) list(input()) list input() input s = [list(input()) for i in range(h)] s [list(input()) for i in range(h)] [0 if s[i][j] == "#" else 1 for j in range(w)] for i in range(h) for i in range(h) i range(h) range h for i in range(h) [0 if s[i][j] == "#" else 1 for j in range(w)] li = [[0 if s[i][j] == "#" else 1 for j in range(w)] for i in range(h)] li [[0 if s[i][j] == "#" else 1 for j in range(w)] for i in range(h)] l, r, u, d = np.array(li), np.array(li), np.array(li), np.array(li) l np.array(li) np.array np array li r np.array(li) np.array np array li u np.array(li) np.array np array li d np.array(li) np.array np array li for i in range(1, h):
    u[i] *= (u[i - 1] + 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 - 1] + 1 u[i - 1] u i - 1 i 1 1 d[-i - 1] *= (d[-i] + 1) d[-i - 1] d -i - 1 -i i 1 d[-i] + 1 d[-i] d -i i 1 for i in range(1, w):
    l[:, i] *= (l[:, i - 1] + 1)
    r[:, -i - 1] *= (r[:, -i] + 1) i range(1, w) range 1 w l[:, i] *= (l[:, i - 1] + 1) l[:, i] l : l[:, i - 1] + 1 l[:, i - 1] l : 1 r[:, -i - 1] *= (r[:, -i] + 1) r[:, -i - 1] r : r[:, -i] + 1 r[:, -i] r : 1 print((l + r + u + d - 3).max()) print (l + r + u + d - 3).max() l + r + u + d - 3).max l + r + u + d - 3 l + r + u + d l + r + u l + r l r u d 3 max h, w = map(int, input().split()) map(int, input().split()) h d = np.array(li), np.array(li), np.array(li), np.array(li) np.array(li) d l, r, u, d = np.array(li), np.array(li), np.array(li), np.array(li) np.array(li) l s = [list(input()) for i in range(h)] [list(input()) for i in range(h)] s r, u, d = np.array(li), np.array(li), np.array(li), np.array(li) np.array(li) r u, d = np.array(li), np.array(li), np.array(li), np.array(li) np.array(li) u li = [[0 if s[i][j] == "#" else 1 for j in range(w)] for i in range(h)] [[0 if s[i][j] == "#" else 1 for j in range(w)] for i in range(h)] li w = map(int, input().split()) map(int, input().split()) w
import numpy as np
h, w = map(int, input().split())
s = [list(input()) for i in range(h)]
li = [[0 if s[i][j] == "#" else 1 for j in range(w)] for i in range(h)]
l, r, u, d = np.array(li), np.array(li), np.array(li), np.array(li)
for i in range(1, h):
    u[i] *= (u[i - 1] + 1)
    d[-i - 1] *= (d[-i] + 1)
for i in range(1, w):
    l[:, i] *= (l[:, i - 1] + 1)
    r[:, -i - 1] *= (r[:, -i] + 1)
print((l + r + u + d - 3).max())