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

tate = [[0] * W for i in range(H)]
yoko = [[0] * W for i in range(H)]

for i in range(H):
	for j in range(W):
		if grid[i][j] == ".":
			if tate[i][j] == 0:
				back = 0
				while(1):
					if 0 > i - back or grid[i - back][j] == "#":
						break
					else:
						back += 1
				forth = 0
				while(1):
					if i + forth >= H or grid[i + forth][j] == "#":
						break
					else:
						forth += 1
				for k in range(-back + 1, forth):
					tate[i + k][j] = forth + back - 1
			if yoko[i][j] == 0:
				back = 0
				while(1):
					if 0 > j - back or grid[i][j - back] == "#":
						break
					else:
						back += 1
				forth = 0
				while(1):
					if j + forth >= W or grid[i][j + forth] == "#":
						break
					else:
						forth += 1
				for k in range(-back + 1, forth):
					yoko[i][j + k] = forth + back - 1

maxl = 0
for i in range(H):
	for j in range(W):
		maxl = max(maxl, tate[i][j] + yoko[i][j] - 1)
print(maxl) H, W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W input() for i in range(H) for i in range(H) i range(H) range H for i in range(H) input() input grid = [input() for i in range(H)] grid [input() for i in range(H)] [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 tate = [[0] * W for i in range(H)] tate [[0] * W for i in range(H)] [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 yoko = [[0] * W for i in range(H)] yoko [[0] * W for i in range(H)] for i in range(H):
	for j in range(W):
		if grid[i][j] == ".":
			if tate[i][j] == 0:
				back = 0
				while(1):
					if 0 > i - back or grid[i - back][j] == "#":
						break
					else:
						back += 1
				forth = 0
				while(1):
					if i + forth >= H or grid[i + forth][j] == "#":
						break
					else:
						forth += 1
				for k in range(-back + 1, forth):
					tate[i + k][j] = forth + back - 1
			if yoko[i][j] == 0:
				back = 0
				while(1):
					if 0 > j - back or grid[i][j - back] == "#":
						break
					else:
						back += 1
				forth = 0
				while(1):
					if j + forth >= W or grid[i][j + forth] == "#":
						break
					else:
						forth += 1
				for k in range(-back + 1, forth):
					yoko[i][j + k] = forth + back - 1 i range(H) range H for j in range(W):
		if grid[i][j] == ".":
			if tate[i][j] == 0:
				back = 0
				while(1):
					if 0 > i - back or grid[i - back][j] == "#":
						break
					else:
						back += 1
				forth = 0
				while(1):
					if i + forth >= H or grid[i + forth][j] == "#":
						break
					else:
						forth += 1
				for k in range(-back + 1, forth):
					tate[i + k][j] = forth + back - 1
			if yoko[i][j] == 0:
				back = 0
				while(1):
					if 0 > j - back or grid[i][j - back] == "#":
						break
					else:
						back += 1
				forth = 0
				while(1):
					if j + forth >= W or grid[i][j + forth] == "#":
						break
					else:
						forth += 1
				for k in range(-back + 1, forth):
					yoko[i][j + k] = forth + back - 1 j range(W) range W if grid[i][j] == ".":
			if tate[i][j] == 0:
				back = 0
				while(1):
					if 0 > i - back or grid[i - back][j] == "#":
						break
					else:
						back += 1
				forth = 0
				while(1):
					if i + forth >= H or grid[i + forth][j] == "#":
						break
					else:
						forth += 1
				for k in range(-back + 1, forth):
					tate[i + k][j] = forth + back - 1
			if yoko[i][j] == 0:
				back = 0
				while(1):
					if 0 > j - back or grid[i][j - back] == "#":
						break
					else:
						back += 1
				forth = 0
				while(1):
					if j + forth >= W or grid[i][j + forth] == "#":
						break
					else:
						forth += 1
				for k in range(-back + 1, forth):
					yoko[i][j + k] = forth + back - 1 grid[i][j] == "." grid[i][j] [i] grid i j "." if tate[i][j] == 0:
				back = 0
				while(1):
					if 0 > i - back or grid[i - back][j] == "#":
						break
					else:
						back += 1
				forth = 0
				while(1):
					if i + forth >= H or grid[i + forth][j] == "#":
						break
					else:
						forth += 1
				for k in range(-back + 1, forth):
					tate[i + k][j] = forth + back - 1
			 tate[i][j] == 0 tate[i][j] [i] tate i j 0 back = 0 back 0 while(1):
					if 0 > i - back or grid[i - back][j] == "#":
						break
					else:
						back += 1
				 1 if 0 > i - back or grid[i - back][j] == "#":
						break
					else:
						back += 1
				 0 > i - back or grid[i - back][j] == "#" 0 > i - back 0 i - back i back grid[i - back][j] == "#" grid[i - back][j] [i - back] grid i - back i back j "#" break back += 1 back 1 forth = 0 forth 0 while(1):
					if i + forth >= H or grid[i + forth][j] == "#":
						break
					else:
						forth += 1
				 1 if i + forth >= H or grid[i + forth][j] == "#":
						break
					else:
						forth += 1
				 i + forth >= H or grid[i + forth][j] == "#" i + forth >= H i + forth i forth H grid[i + forth][j] == "#" grid[i + forth][j] [i + forth] grid i + forth i forth j "#" break forth += 1 forth 1 for k in range(-back + 1, forth):
					tate[i + k][j] = forth + back - 1
			 k range(-back + 1, forth) range -back + 1 -back back 1 forth tate[i + k][j] = forth + back - 1 tate[i + k][j] [i + k] tate i + k i k j forth + back - 1 forth + back forth back 1 if yoko[i][j] == 0:
				back = 0
				while(1):
					if 0 > j - back or grid[i][j - back] == "#":
						break
					else:
						back += 1
				forth = 0
				while(1):
					if j + forth >= W or grid[i][j + forth] == "#":
						break
					else:
						forth += 1
				for k in range(-back + 1, forth):
					yoko[i][j + k] = forth + back - 1 yoko[i][j] == 0 yoko[i][j] [i] yoko i j 0 back = 0 back 0 while(1):
					if 0 > j - back or grid[i][j - back] == "#":
						break
					else:
						back += 1
				 1 if 0 > j - back or grid[i][j - back] == "#":
						break
					else:
						back += 1
				 0 > j - back or grid[i][j - back] == "#" 0 > j - back 0 j - back j back grid[i][j - back] == "#" grid[i][j - back] [i] grid i j - back j back "#" break back += 1 back 1 forth = 0 forth 0 while(1):
					if j + forth >= W or grid[i][j + forth] == "#":
						break
					else:
						forth += 1
				 1 if j + forth >= W or grid[i][j + forth] == "#":
						break
					else:
						forth += 1
				 j + forth >= W or grid[i][j + forth] == "#" j + forth >= W j + forth j forth W grid[i][j + forth] == "#" grid[i][j + forth] [i] grid i j + forth j forth "#" break forth += 1 forth 1 for k in range(-back + 1, forth):
					yoko[i][j + k] = forth + back - 1 k range(-back + 1, forth) range -back + 1 -back back 1 forth yoko[i][j + k] = forth + back - 1 yoko[i][j + k] [i] yoko i j + k j k forth + back - 1 forth + back forth back 1 maxl = 0 maxl 0 for i in range(H):
	for j in range(W):
		maxl = max(maxl, tate[i][j] + yoko[i][j] - 1) i range(H) range H for j in range(W):
		maxl = max(maxl, tate[i][j] + yoko[i][j] - 1) j range(W) range W maxl = max(maxl, tate[i][j] + yoko[i][j] - 1) maxl max(maxl, tate[i][j] + yoko[i][j] - 1) max maxl tate[i][j] + yoko[i][j] - 1 tate[i][j] + yoko[i][j] tate[i][j] [i] tate i j yoko[i][j] [i] yoko i j 1 print(maxl) print maxl maxl = 0 0 maxl back += 1 1 back grid = [input() for i in range(H)] [input() for i in range(H)] grid forth = 0 0 forth back = 0 0 back back += 1 1 back tate = [[0] * W for i in range(H)] [[0] * W for i in range(H)] tate yoko = [[0] * W for i in range(H)] [[0] * W for i in range(H)] yoko back = 0 0 back forth += 1 1 forth forth = 0 0 forth H, W = map(int, input().split()) map(int, input().split()) H forth += 1 1 forth maxl = max(maxl, tate[i][j] + yoko[i][j] - 1) max(maxl, tate[i][j] + yoko[i][j] - 1) maxl W = map(int, input().split()) map(int, input().split()) W
H, W = map(int, input().split())
grid = [input() for i in range(H)]

tate = [[0] * W for i in range(H)]
yoko = [[0] * W for i in range(H)]

for i in range(H):
	for j in range(W):
		if grid[i][j] == ".":
			if tate[i][j] == 0:
				back = 0
				while(1):
					if 0 > i - back or grid[i - back][j] == "#":
						break
					else:
						back += 1
				forth = 0
				while(1):
					if i + forth >= H or grid[i + forth][j] == "#":
						break
					else:
						forth += 1
				for k in range(-back + 1, forth):
					tate[i + k][j] = forth + back - 1
			if yoko[i][j] == 0:
				back = 0
				while(1):
					if 0 > j - back or grid[i][j - back] == "#":
						break
					else:
						back += 1
				forth = 0
				while(1):
					if j + forth >= W or grid[i][j + forth] == "#":
						break
					else:
						forth += 1
				for k in range(-back + 1, forth):
					yoko[i][j + k] = forth + back - 1

maxl = 0
for i in range(H):
	for j in range(W):
		maxl = max(maxl, tate[i][j] + yoko[i][j] - 1)
print(maxl)