H,W=list(map(int,input().split()))
import numpy as np
m=np.array([[0 if i=="#" else 1 for i in input()] for i in range(H)])
l,r,u,d=np.zeros((4,H,W))
for i in range(H):
   u[i]=(u[i-1]+1)*m[i]
   d[-i-1]=(d[-i]+1)*m[-i-1]
for i in range(W):
   r[:,i]=(r[:,i-1]+1)*m[:,i]
   l[:,-i-1]=(l[:,-i]+1)*m[:,-i-1]
print(int(np.max(u+r+l+d))-3) H,W=list(map(int,input().split())) H list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split W import numpy as np numpy [0 if i=="#" else 1 for i in input()] for i in range(H) for i in range(H) i range(H) range H for i in range(H) [0 if i=="#" else 1 for i in input()] m=np.array([[0 if i=="#" else 1 for i in input()] for i in range(H)]) m np.array([[0 if i=="#" else 1 for i in input()] for i in range(H)]) np.array np array [[0 if i=="#" else 1 for i in input()] for i in range(H)] l,r,u,d=np.zeros((4,H,W)) l np.zeros((4,H,W)) np.zeros np zeros (4,H,W) 4 H W r u d for i in range(H):
   u[i]=(u[i-1]+1)*m[i]
   d[-i-1]=(d[-i]+1)*m[-i-1] i range(H) range H u[i]=(u[i-1]+1)*m[i] u[i] u i (u[i-1]+1)*m[i] u[i-1]+1 u[i-1] u i-1 i 1 1 m[i] m i d[-i-1]=(d[-i]+1)*m[-i-1] d[-i-1] d -i-1 -i i 1 (d[-i]+1)*m[-i-1] d[-i]+1 d[-i] d -i i 1 m[-i-1] m -i-1 -i i 1 for i in range(W):
   r[:,i]=(r[:,i-1]+1)*m[:,i]
   l[:,-i-1]=(l[:,-i]+1)*m[:,-i-1] i range(W) range W r[:,i]=(r[:,i-1]+1)*m[:,i] r[:,i] r : (r[:,i-1]+1)*m[:,i] r[:,i-1]+1 r[:,i-1] r : 1 m[:,i] m : l[:,-i-1]=(l[:,-i]+1)*m[:,-i-1] l[:,-i-1] l : (l[:,-i]+1)*m[:,-i-1] l[:,-i]+1 l[:,-i] l : 1 m[:,-i-1] m : print(int(np.max(u+r+l+d))-3) print int(np.max(u+r+l+d))-3 int(np.max(u+r+l+d)) int np.max(u+r+l+d) np.max np max u+r+l+d u+r+l u+r u r l d 3 W=list(map(int,input().split())) list(map(int,input().split())) W m=np.array([[0 if i=="#" else 1 for i in input()] for i in range(H)]) np.array([[0 if i=="#" else 1 for i in input()] for i in range(H)]) m H,W=list(map(int,input().split())) list(map(int,input().split())) H r,u,d=np.zeros((4,H,W)) np.zeros((4,H,W)) r l,r,u,d=np.zeros((4,H,W)) np.zeros((4,H,W)) l d=np.zeros((4,H,W)) np.zeros((4,H,W)) d u,d=np.zeros((4,H,W)) np.zeros((4,H,W)) u
H,W=list(map(int,input().split()))
import numpy as np
m=np.array([[0 if i=="#" else 1 for i in input()] for i in range(H)])
l,r,u,d=np.zeros((4,H,W))
for i in range(H):
   u[i]=(u[i-1]+1)*m[i]
   d[-i-1]=(d[-i]+1)*m[-i-1]
for i in range(W):
   r[:,i]=(r[:,i-1]+1)*m[:,i]
   l[:,-i-1]=(l[:,-i]+1)*m[:,-i-1]
print(int(np.max(u+r+l+d))-3)