import numpy as np

h, w  = map(int,input().split())
sn = [[0]*w for i in range(h)]
 
for i in range(h):
    s = input()
    for j in range(w):
        if s[j] == '.':
            sn[i][j] = 1
sn = np.array(sn)
score = np.zeros_like(sn)
total = np.zeros_like(sn)

score[0] += sn[0]
for i in range(1, h):
    score[i] = (score[i-1] + sn[i]) * sn[i]
total += score

score[h-1] = sn[h-1]
for i in range(h-2, -1, -1):
    score[i] = (score[i+1] + sn[i]) * sn[i]
total += score

score[:,0] = sn[:,0]
for i in range(1, w):
    score[:,i] = (score[:,i-1] + sn[:,i]) * sn[:,i]
total += score

score[:,w-1] = sn[:,w-1]
for i in range(w-2, -1, -1):
    score[:,i] = (score[:,i+1] + sn[:,i]) * sn[:,i]
total += score
    
print(total.max()-3) import numpy as np numpy h, w  = map(int,input().split()) h map(int,input().split()) map int input().split() ().split () input split w [0]*w for i in range(h) for i in range(h) i range(h) range h for i in range(h) [0]*w [0] 0 w sn = [[0]*w for i in range(h)] sn [[0]*w for i in range(h)] for i in range(h):
    s = input()
    for j in range(w):
        if s[j] == '.':
            sn[i][j] = 1 i range(h) range h s = input() s input() input for j in range(w):
        if s[j] == '.':
            sn[i][j] = 1 j range(w) range w if s[j] == '.':
            sn[i][j] = 1 s[j] == '.' s[j] s j '.' sn[i][j] = 1 sn[i][j] [i] sn i j 1 sn = np.array(sn) sn np.array(sn) np.array np array sn score = np.zeros_like(sn) score np.zeros_like(sn) np.zeros_like np zeros_like sn total = np.zeros_like(sn) total np.zeros_like(sn) np.zeros_like np zeros_like sn score[0] += sn[0] score[0] score 0 sn[0] sn 0 for i in range(1, h):
    score[i] = (score[i-1] + sn[i]) * sn[i] i range(1, h) range 1 h score[i] = (score[i-1] + sn[i]) * sn[i] score[i] score i (score[i-1] + sn[i]) * sn[i] score[i-1] + sn[i] score[i-1] score i-1 i 1 sn[i] sn i sn[i] sn i total += score total score score[h-1] = sn[h-1] score[h-1] score h-1 h 1 sn[h-1] sn h-1 h 1 for i in range(h-2, -1, -1):
    score[i] = (score[i+1] + sn[i]) * sn[i] i range(h-2, -1, -1) range h-2 h 2 -1 -1 score[i] = (score[i+1] + sn[i]) * sn[i] score[i] score i (score[i+1] + sn[i]) * sn[i] score[i+1] + sn[i] score[i+1] score i+1 i 1 sn[i] sn i sn[i] sn i total += score total score score[:,0] = sn[:,0] score[:,0] score : sn[:,0] sn : for i in range(1, w):
    score[:,i] = (score[:,i-1] + sn[:,i]) * sn[:,i] i range(1, w) range 1 w score[:,i] = (score[:,i-1] + sn[:,i]) * sn[:,i] score[:,i] score : (score[:,i-1] + sn[:,i]) * sn[:,i] score[:,i-1] + sn[:,i] score[:,i-1] score : sn[:,i] sn : sn[:,i] sn : total += score total score score[:,w-1] = sn[:,w-1] score[:,w-1] score : sn[:,w-1] sn : for i in range(w-2, -1, -1):
    score[:,i] = (score[:,i+1] + sn[:,i]) * sn[:,i] i range(w-2, -1, -1) range w-2 w 2 -1 -1 score[:,i] = (score[:,i+1] + sn[:,i]) * sn[:,i] score[:,i] score : (score[:,i+1] + sn[:,i]) * sn[:,i] score[:,i+1] + sn[:,i] score[:,i+1] score : sn[:,i] sn : sn[:,i] sn : total += score total score print(total.max()-3) print total.max()-3 total.max() total.max total max 3 total += score score total w  = map(int,input().split()) map(int,input().split()) w h, w  = map(int,input().split()) map(int,input().split()) h score = np.zeros_like(sn) np.zeros_like(sn) score total += score score total sn = np.array(sn) np.array(sn) sn total += score score total sn = [[0]*w for i in range(h)] [[0]*w for i in range(h)] sn s = input() input() s total = np.zeros_like(sn) np.zeros_like(sn) total total += score score total
import numpy as np

h, w  = map(int,input().split())
sn = [[0]*w for i in range(h)]
 
for i in range(h):
    s = input()
    for j in range(w):
        if s[j] == '.':
            sn[i][j] = 1
sn = np.array(sn)
score = np.zeros_like(sn)
total = np.zeros_like(sn)

score[0] += sn[0]
for i in range(1, h):
    score[i] = (score[i-1] + sn[i]) * sn[i]
total += score

score[h-1] = sn[h-1]
for i in range(h-2, -1, -1):
    score[i] = (score[i+1] + sn[i]) * sn[i]
total += score

score[:,0] = sn[:,0]
for i in range(1, w):
    score[:,i] = (score[:,i-1] + sn[:,i]) * sn[:,i]
total += score

score[:,w-1] = sn[:,w-1]
for i in range(w-2, -1, -1):
    score[:,i] = (score[:,i+1] + sn[:,i]) * sn[:,i]
total += score
    
print(total.max()-3)