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

Left  = [[0] * 2100 for _ in range(2100)]
Right = [[0] * 2100 for _ in range(2100)]
Up    = [[0] * 2100 for _ in range(2100)]
Down  = [[0] * 2100 for _ in range(2100)]

for i in range(H):
	cur = 0
	for j in range(W):
		if S[i][j] == '#':
			cur = 0
		else:
			cur += 1
		Left[i][j] = cur

for i in range(H):
	cur = 0
	for j in range(W-1, -1, -1):
		if S[i][j] == '#':
			cur = 0
		else:
			cur += 1
		Right[i][j] = cur

for j in range(W):
	cur = 0
	for i in range(H):
		if S[i][j] == '#':
			cur = 0
		else:
			cur += 1
		Up[i][j] = cur

for j in range(W):
	cur = 0
	for i in range(H-1, -1, -1):
		if S[i][j] == '#':
			cur = 0
		else:
			cur += 1
		Down[i][j] = cur

cnt = 0
for i in range(H):
	for j in range(W):
		if S[i][j] == '#':
			continue
		cnt = max(cnt, Left[i][j] + Right[i][j] + Up[i][j] + Down[i][j] - 3)

print(cnt) 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] * 2100 for _ in range(2100) for _ in range(2100) _ range(2100) range 2100 for _ in range(2100) [0] * 2100 [0] 0 2100 Left  = [[0] * 2100 for _ in range(2100)] Left [[0] * 2100 for _ in range(2100)] [0] * 2100 for _ in range(2100) for _ in range(2100) _ range(2100) range 2100 for _ in range(2100) [0] * 2100 [0] 0 2100 Right = [[0] * 2100 for _ in range(2100)] Right [[0] * 2100 for _ in range(2100)] [0] * 2100 for _ in range(2100) for _ in range(2100) _ range(2100) range 2100 for _ in range(2100) [0] * 2100 [0] 0 2100 Up    = [[0] * 2100 for _ in range(2100)] Up [[0] * 2100 for _ in range(2100)] [0] * 2100 for _ in range(2100) for _ in range(2100) _ range(2100) range 2100 for _ in range(2100) [0] * 2100 [0] 0 2100 Down  = [[0] * 2100 for _ in range(2100)] Down [[0] * 2100 for _ in range(2100)] for i in range(H):
	cur = 0
	for j in range(W):
		if S[i][j] == '#':
			cur = 0
		else:
			cur += 1
		Left[i][j] = cur i range(H) range H cur = 0 cur 0 for j in range(W):
		if S[i][j] == '#':
			cur = 0
		else:
			cur += 1
		Left[i][j] = cur j range(W) range W if S[i][j] == '#':
			cur = 0
		else:
			cur += 1
		 S[i][j] == '#' S[i][j] [i] S i j '#' cur = 0 cur 0 cur += 1 cur 1 Left[i][j] = cur Left[i][j] [i] Left i j cur for i in range(H):
	cur = 0
	for j in range(W-1, -1, -1):
		if S[i][j] == '#':
			cur = 0
		else:
			cur += 1
		Right[i][j] = cur i range(H) range H cur = 0 cur 0 for j in range(W-1, -1, -1):
		if S[i][j] == '#':
			cur = 0
		else:
			cur += 1
		Right[i][j] = cur j range(W-1, -1, -1) range W-1 W 1 -1 -1 if S[i][j] == '#':
			cur = 0
		else:
			cur += 1
		 S[i][j] == '#' S[i][j] [i] S i j '#' cur = 0 cur 0 cur += 1 cur 1 Right[i][j] = cur Right[i][j] [i] Right i j cur for j in range(W):
	cur = 0
	for i in range(H):
		if S[i][j] == '#':
			cur = 0
		else:
			cur += 1
		Up[i][j] = cur j range(W) range W cur = 0 cur 0 for i in range(H):
		if S[i][j] == '#':
			cur = 0
		else:
			cur += 1
		Up[i][j] = cur i range(H) range H if S[i][j] == '#':
			cur = 0
		else:
			cur += 1
		 S[i][j] == '#' S[i][j] [i] S i j '#' cur = 0 cur 0 cur += 1 cur 1 Up[i][j] = cur Up[i][j] [i] Up i j cur for j in range(W):
	cur = 0
	for i in range(H-1, -1, -1):
		if S[i][j] == '#':
			cur = 0
		else:
			cur += 1
		Down[i][j] = cur j range(W) range W cur = 0 cur 0 for i in range(H-1, -1, -1):
		if S[i][j] == '#':
			cur = 0
		else:
			cur += 1
		Down[i][j] = cur i range(H-1, -1, -1) range H-1 H 1 -1 -1 if S[i][j] == '#':
			cur = 0
		else:
			cur += 1
		 S[i][j] == '#' S[i][j] [i] S i j '#' cur = 0 cur 0 cur += 1 cur 1 Down[i][j] = cur Down[i][j] [i] Down i j cur cnt = 0 cnt 0 for i in range(H):
	for j in range(W):
		if S[i][j] == '#':
			continue
		cnt = max(cnt, Left[i][j] + Right[i][j] + Up[i][j] + Down[i][j] - 3) i range(H) range H for j in range(W):
		if S[i][j] == '#':
			continue
		cnt = max(cnt, Left[i][j] + Right[i][j] + Up[i][j] + Down[i][j] - 3) j range(W) range W if S[i][j] == '#':
			continue
		 S[i][j] == '#' S[i][j] [i] S i j '#' continue cnt = max(cnt, Left[i][j] + Right[i][j] + Up[i][j] + Down[i][j] - 3) cnt max(cnt, Left[i][j] + Right[i][j] + Up[i][j] + Down[i][j] - 3) max cnt Left[i][j] + Right[i][j] + Up[i][j] + Down[i][j] - 3 Left[i][j] + Right[i][j] + Up[i][j] + Down[i][j] Left[i][j] + Right[i][j] + Up[i][j] Left[i][j] + Right[i][j] Left[i][j] [i] Left i j Right[i][j] [i] Right i j Up[i][j] [i] Up i j Down[i][j] [i] Down i j 3 print(cnt) print cnt W = map(int, input().split()) map(int, input().split()) W Left  = [[0] * 2100 for _ in range(2100)] [[0] * 2100 for _ in range(2100)] Left cur = 0 0 cur Down  = [[0] * 2100 for _ in range(2100)] [[0] * 2100 for _ in range(2100)] Down Right = [[0] * 2100 for _ in range(2100)] [[0] * 2100 for _ in range(2100)] Right cur += 1 1 cur H, W = map(int, input().split()) map(int, input().split()) H cur += 1 1 cur cur = 0 0 cur cur = 0 0 cur cnt = max(cnt, Left[i][j] + Right[i][j] + Up[i][j] + Down[i][j] - 3) max(cnt, Left[i][j] + Right[i][j] + Up[i][j] + Down[i][j] - 3) cnt S = [input() for _ in range(H)] [input() for _ in range(H)] S Up    = [[0] * 2100 for _ in range(2100)] [[0] * 2100 for _ in range(2100)] Up cur = 0 0 cur cur += 1 1 cur cur = 0 0 cur cur += 1 1 cur cur = 0 0 cur cur = 0 0 cur cnt = 0 0 cnt cur = 0 0 cur
H, W = map(int, input().split())
S = [input() for _ in range(H)]

Left  = [[0] * 2100 for _ in range(2100)]
Right = [[0] * 2100 for _ in range(2100)]
Up    = [[0] * 2100 for _ in range(2100)]
Down  = [[0] * 2100 for _ in range(2100)]

for i in range(H):
	cur = 0
	for j in range(W):
		if S[i][j] == '#':
			cur = 0
		else:
			cur += 1
		Left[i][j] = cur

for i in range(H):
	cur = 0
	for j in range(W-1, -1, -1):
		if S[i][j] == '#':
			cur = 0
		else:
			cur += 1
		Right[i][j] = cur

for j in range(W):
	cur = 0
	for i in range(H):
		if S[i][j] == '#':
			cur = 0
		else:
			cur += 1
		Up[i][j] = cur

for j in range(W):
	cur = 0
	for i in range(H-1, -1, -1):
		if S[i][j] == '#':
			cur = 0
		else:
			cur += 1
		Down[i][j] = cur

cnt = 0
for i in range(H):
	for j in range(W):
		if S[i][j] == '#':
			continue
		cnt = max(cnt, Left[i][j] + Right[i][j] + Up[i][j] + Down[i][j] - 3)

print(cnt)