H, W = map(int, input().split())
S = [input() for _ in range(H)]

# そのマスを含めてLeft, Right, Up, Downにそれぞれ何マス分明かりを照らせるかを配列に記録
L = [[0] * W for _ in range(H)]
R = [[0] * W for _ in range(H)]
D = [[0] * W for _ in range(H)]
U = [[0] * W for _ in range(H)]

for i in range(H):
	for j in range(W):
		if S[i][j] == ".":
			if j == 0:
				L[i][j] = 1
			else:
				L[i][j] = L[i][j - 1] + 1

for i in range(H):
	for j in range(W - 1, -1, -1):
		if S[i][j] == ".":
			if j == W - 1:
				R[i][j] = 1
			else:
				R[i][j] = R[i][j + 1] + 1

for j in range(W):
	for i in range(H - 1, -1, -1):
		if S[i][j] == ".":
			if i == H - 1:
				D[i][j] = 1
			else:
				D[i][j] = D[i + 1][j] + 1

for j in range(W):
	for i in range(H):
		if S[i][j] == ".":
			if i == 0:
				U[i][j] = 1
			else:
				U[i][j] = U[i - 1][j] + 1


ans = 0
X = [[0] * W for _ in range(H)]
for i in range(H):
	for j in range(W):
		X[i][j] = L[i][j] + R[i][j] + D[i][j] + U[i][j] - 3
	ans = max(ans, max(X[i]))

print(ans) H, W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W input() for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) input() input S = [input() for _ in range(H)] S [input() for _ in range(H)] [0] * W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0] * W [0] 0 W L = [[0] * W for _ in range(H)] L [[0] * W for _ in range(H)] [0] * W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0] * W [0] 0 W R = [[0] * W for _ in range(H)] R [[0] * W for _ in range(H)] [0] * W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0] * W [0] 0 W D = [[0] * W for _ in range(H)] D [[0] * W for _ in range(H)] [0] * W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0] * W [0] 0 W U = [[0] * W for _ in range(H)] U [[0] * W for _ in range(H)] for i in range(H):
	for j in range(W):
		if S[i][j] == ".":
			if j == 0:
				L[i][j] = 1
			else:
				L[i][j] = L[i][j - 1] + 1 i range(H) range H for j in range(W):
		if S[i][j] == ".":
			if j == 0:
				L[i][j] = 1
			else:
				L[i][j] = L[i][j - 1] + 1 j range(W) range W if S[i][j] == ".":
			if j == 0:
				L[i][j] = 1
			else:
				L[i][j] = L[i][j - 1] + 1 S[i][j] == "." S[i][j] [i] S i j "." if j == 0:
				L[i][j] = 1
			else:
				L[i][j] = L[i][j - 1] + 1 j == 0 j 0 L[i][j] = 1 L[i][j] [i] L i j 1 L[i][j] = L[i][j - 1] + 1 L[i][j] [i] L i j L[i][j - 1] + 1 L[i][j - 1] [i] L i j - 1 j 1 1 for i in range(H):
	for j in range(W - 1, -1, -1):
		if S[i][j] == ".":
			if j == W - 1:
				R[i][j] = 1
			else:
				R[i][j] = R[i][j + 1] + 1 i range(H) range H for j in range(W - 1, -1, -1):
		if S[i][j] == ".":
			if j == W - 1:
				R[i][j] = 1
			else:
				R[i][j] = R[i][j + 1] + 1 j range(W - 1, -1, -1) range W - 1 W 1 -1 -1 if S[i][j] == ".":
			if j == W - 1:
				R[i][j] = 1
			else:
				R[i][j] = R[i][j + 1] + 1 S[i][j] == "." S[i][j] [i] S i j "." if j == W - 1:
				R[i][j] = 1
			else:
				R[i][j] = R[i][j + 1] + 1 j == W - 1 j W - 1 W 1 R[i][j] = 1 R[i][j] [i] R i j 1 R[i][j] = R[i][j + 1] + 1 R[i][j] [i] R i j R[i][j + 1] + 1 R[i][j + 1] [i] R i j + 1 j 1 1 for j in range(W):
	for i in range(H - 1, -1, -1):
		if S[i][j] == ".":
			if i == H - 1:
				D[i][j] = 1
			else:
				D[i][j] = D[i + 1][j] + 1 j range(W) range W for i in range(H - 1, -1, -1):
		if S[i][j] == ".":
			if i == H - 1:
				D[i][j] = 1
			else:
				D[i][j] = D[i + 1][j] + 1 i range(H - 1, -1, -1) range H - 1 H 1 -1 -1 if S[i][j] == ".":
			if i == H - 1:
				D[i][j] = 1
			else:
				D[i][j] = D[i + 1][j] + 1 S[i][j] == "." S[i][j] [i] S i j "." if i == H - 1:
				D[i][j] = 1
			else:
				D[i][j] = D[i + 1][j] + 1 i == H - 1 i H - 1 H 1 D[i][j] = 1 D[i][j] [i] D i j 1 D[i][j] = D[i + 1][j] + 1 D[i][j] [i] D i j D[i + 1][j] + 1 D[i + 1][j] [i + 1] D i + 1 i 1 j 1 for j in range(W):
	for i in range(H):
		if S[i][j] == ".":
			if i == 0:
				U[i][j] = 1
			else:
				U[i][j] = U[i - 1][j] + 1 j range(W) range W for i in range(H):
		if S[i][j] == ".":
			if i == 0:
				U[i][j] = 1
			else:
				U[i][j] = U[i - 1][j] + 1 i range(H) range H if S[i][j] == ".":
			if i == 0:
				U[i][j] = 1
			else:
				U[i][j] = U[i - 1][j] + 1 S[i][j] == "." S[i][j] [i] S i j "." if i == 0:
				U[i][j] = 1
			else:
				U[i][j] = U[i - 1][j] + 1 i == 0 i 0 U[i][j] = 1 U[i][j] [i] U i j 1 U[i][j] = U[i - 1][j] + 1 U[i][j] [i] U i j U[i - 1][j] + 1 U[i - 1][j] [i - 1] U i - 1 i 1 j 1 ans = 0 ans 0 [0] * W for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0] * W [0] 0 W X = [[0] * W for _ in range(H)] X [[0] * W for _ in range(H)] for i in range(H):
	for j in range(W):
		X[i][j] = L[i][j] + R[i][j] + D[i][j] + U[i][j] - 3
	ans = max(ans, max(X[i])) i range(H) range H for j in range(W):
		X[i][j] = L[i][j] + R[i][j] + D[i][j] + U[i][j] - 3
	 j range(W) range W X[i][j] = L[i][j] + R[i][j] + D[i][j] + U[i][j] - 3 X[i][j] [i] X i j L[i][j] + R[i][j] + D[i][j] + U[i][j] - 3 L[i][j] + R[i][j] + D[i][j] + U[i][j] L[i][j] + R[i][j] + D[i][j] L[i][j] + R[i][j] L[i][j] [i] L i j R[i][j] [i] R i j D[i][j] [i] D i j U[i][j] [i] U i j 3 ans = max(ans, max(X[i])) ans max(ans, max(X[i])) max ans max(X[i]) max X[i] X i print(ans) print ans ans = max(ans, max(X[i])) max(ans, max(X[i])) ans D = [[0] * W for _ in range(H)] [[0] * W for _ in range(H)] D L = [[0] * W for _ in range(H)] [[0] * W for _ in range(H)] L U = [[0] * W for _ in range(H)] [[0] * W for _ in range(H)] U S = [input() for _ in range(H)] [input() for _ in range(H)] S R = [[0] * W for _ in range(H)] [[0] * W for _ in range(H)] R H, W = map(int, input().split()) map(int, input().split()) H ans = 0 0 ans X = [[0] * W for _ in range(H)] [[0] * W for _ in range(H)] X W = map(int, input().split()) map(int, input().split()) W
H, W = map(int, input().split())
S = [input() for _ in range(H)]

# そのマスを含めてLeft, Right, Up, Downにそれぞれ何マス分明かりを照らせるかを配列に記録
L = [[0] * W for _ in range(H)]
R = [[0] * W for _ in range(H)]
D = [[0] * W for _ in range(H)]
U = [[0] * W for _ in range(H)]

for i in range(H):
	for j in range(W):
		if S[i][j] == ".":
			if j == 0:
				L[i][j] = 1
			else:
				L[i][j] = L[i][j - 1] + 1

for i in range(H):
	for j in range(W - 1, -1, -1):
		if S[i][j] == ".":
			if j == W - 1:
				R[i][j] = 1
			else:
				R[i][j] = R[i][j + 1] + 1

for j in range(W):
	for i in range(H - 1, -1, -1):
		if S[i][j] == ".":
			if i == H - 1:
				D[i][j] = 1
			else:
				D[i][j] = D[i + 1][j] + 1

for j in range(W):
	for i in range(H):
		if S[i][j] == ".":
			if i == 0:
				U[i][j] = 1
			else:
				U[i][j] = U[i - 1][j] + 1


ans = 0
X = [[0] * W for _ in range(H)]
for i in range(H):
	for j in range(W):
		X[i][j] = L[i][j] + R[i][j] + D[i][j] + U[i][j] - 3
	ans = max(ans, max(X[i]))

print(ans)