H,W = map(int,input().split())
G=[input() for _ in range(H)]
A_u=[[0 for _ in range(W)] for _ in range(H)]
A_d=[[0 for _ in range(W)] for _ in range(H)]
A_r=[[0 for _ in range(W)] for _ in range(H)]
A_l=[[0 for _ in range(W)] for _ in range(H)]
for h in range(H):
  for w in range(1,W):
    if G[h][w-1] == '.':
      A_r[h][w] = A_r[h][w-1]+1
  for w in range(W-2,-1,-1):
    if G[h][w+1] == '.':
      A_l[h][w] = A_l[h][w+1]+1
for w in range(W):
  for h in range(1,H):
    if G[h-1][w] == '.':
      A_d[h][w] = A_d[h-1][w]+1
  for h in range(H-2,-1,-1):
    if G[h+1][w] == '.':
      A_u[h][w] = A_u[h+1][w]+1
ans=0
for h in range(H):
  for w in range(W):
    if G[h][w] == '.':
      ans = max(ans,A_r[h][w]+A_l[h][w]+A_d[h][w]+A_u[h][w]+1)
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 G=[input() for _ in range(H)] G [input() for _ in range(H)] [0 for _ in range(W)] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0 for _ in range(W)] A_u=[[0 for _ in range(W)] for _ in range(H)] A_u [[0 for _ in range(W)] for _ in range(H)] [0 for _ in range(W)] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0 for _ in range(W)] A_d=[[0 for _ in range(W)] for _ in range(H)] A_d [[0 for _ in range(W)] for _ in range(H)] [0 for _ in range(W)] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0 for _ in range(W)] A_r=[[0 for _ in range(W)] for _ in range(H)] A_r [[0 for _ in range(W)] for _ in range(H)] [0 for _ in range(W)] for _ in range(H) for _ in range(H) _ range(H) range H for _ in range(H) [0 for _ in range(W)] A_l=[[0 for _ in range(W)] for _ in range(H)] A_l [[0 for _ in range(W)] for _ in range(H)] for h in range(H):
  for w in range(1,W):
    if G[h][w-1] == '.':
      A_r[h][w] = A_r[h][w-1]+1
  for w in range(W-2,-1,-1):
    if G[h][w+1] == '.':
      A_l[h][w] = A_l[h][w+1]+1 h range(H) range H for w in range(1,W):
    if G[h][w-1] == '.':
      A_r[h][w] = A_r[h][w-1]+1
   w range(1,W) range 1 W if G[h][w-1] == '.':
      A_r[h][w] = A_r[h][w-1]+1
   G[h][w-1] == '.' G[h][w-1] [h] G h w-1 w 1 '.' A_r[h][w] = A_r[h][w-1]+1 A_r[h][w] [h] A_r h w A_r[h][w-1]+1 A_r[h][w-1] [h] A_r h w-1 w 1 1 for w in range(W-2,-1,-1):
    if G[h][w+1] == '.':
      A_l[h][w] = A_l[h][w+1]+1 w range(W-2,-1,-1) range W-2 W 2 -1 -1 if G[h][w+1] == '.':
      A_l[h][w] = A_l[h][w+1]+1 G[h][w+1] == '.' G[h][w+1] [h] G h w+1 w 1 '.' A_l[h][w] = A_l[h][w+1]+1 A_l[h][w] [h] A_l h w A_l[h][w+1]+1 A_l[h][w+1] [h] A_l h w+1 w 1 1 for w in range(W):
  for h in range(1,H):
    if G[h-1][w] == '.':
      A_d[h][w] = A_d[h-1][w]+1
  for h in range(H-2,-1,-1):
    if G[h+1][w] == '.':
      A_u[h][w] = A_u[h+1][w]+1 w range(W) range W for h in range(1,H):
    if G[h-1][w] == '.':
      A_d[h][w] = A_d[h-1][w]+1
   h range(1,H) range 1 H if G[h-1][w] == '.':
      A_d[h][w] = A_d[h-1][w]+1
   G[h-1][w] == '.' G[h-1][w] [h-1] G h-1 h 1 w '.' A_d[h][w] = A_d[h-1][w]+1 A_d[h][w] [h] A_d h w A_d[h-1][w]+1 A_d[h-1][w] [h-1] A_d h-1 h 1 w 1 for h in range(H-2,-1,-1):
    if G[h+1][w] == '.':
      A_u[h][w] = A_u[h+1][w]+1 h range(H-2,-1,-1) range H-2 H 2 -1 -1 if G[h+1][w] == '.':
      A_u[h][w] = A_u[h+1][w]+1 G[h+1][w] == '.' G[h+1][w] [h+1] G h+1 h 1 w '.' A_u[h][w] = A_u[h+1][w]+1 A_u[h][w] [h] A_u h w A_u[h+1][w]+1 A_u[h+1][w] [h+1] A_u h+1 h 1 w 1 ans=0 ans 0 for h in range(H):
  for w in range(W):
    if G[h][w] == '.':
      ans = max(ans,A_r[h][w]+A_l[h][w]+A_d[h][w]+A_u[h][w]+1) h range(H) range H for w in range(W):
    if G[h][w] == '.':
      ans = max(ans,A_r[h][w]+A_l[h][w]+A_d[h][w]+A_u[h][w]+1) w range(W) range W if G[h][w] == '.':
      ans = max(ans,A_r[h][w]+A_l[h][w]+A_d[h][w]+A_u[h][w]+1) G[h][w] == '.' G[h][w] [h] G h w '.' ans = max(ans,A_r[h][w]+A_l[h][w]+A_d[h][w]+A_u[h][w]+1) ans max(ans,A_r[h][w]+A_l[h][w]+A_d[h][w]+A_u[h][w]+1) max ans A_r[h][w]+A_l[h][w]+A_d[h][w]+A_u[h][w]+1 A_r[h][w]+A_l[h][w]+A_d[h][w]+A_u[h][w] A_r[h][w]+A_l[h][w]+A_d[h][w] A_r[h][w]+A_l[h][w] A_r[h][w] [h] A_r h w A_l[h][w] [h] A_l h w A_d[h][w] [h] A_d h w A_u[h][w] [h] A_u h w 1 print(ans) print ans A_l=[[0 for _ in range(W)] for _ in range(H)] [[0 for _ in range(W)] for _ in range(H)] A_l A_r=[[0 for _ in range(W)] for _ in range(H)] [[0 for _ in range(W)] for _ in range(H)] A_r ans=0 0 ans G=[input() for _ in range(H)] [input() for _ in range(H)] G W = map(int,input().split()) map(int,input().split()) W A_d=[[0 for _ in range(W)] for _ in range(H)] [[0 for _ in range(W)] for _ in range(H)] A_d H,W = map(int,input().split()) map(int,input().split()) H A_u=[[0 for _ in range(W)] for _ in range(H)] [[0 for _ in range(W)] for _ in range(H)] A_u ans = max(ans,A_r[h][w]+A_l[h][w]+A_d[h][w]+A_u[h][w]+1) max(ans,A_r[h][w]+A_l[h][w]+A_d[h][w]+A_u[h][w]+1) ans
H,W = map(int,input().split())
G=[input() for _ in range(H)]
A_u=[[0 for _ in range(W)] for _ in range(H)]
A_d=[[0 for _ in range(W)] for _ in range(H)]
A_r=[[0 for _ in range(W)] for _ in range(H)]
A_l=[[0 for _ in range(W)] for _ in range(H)]
for h in range(H):
  for w in range(1,W):
    if G[h][w-1] == '.':
      A_r[h][w] = A_r[h][w-1]+1
  for w in range(W-2,-1,-1):
    if G[h][w+1] == '.':
      A_l[h][w] = A_l[h][w+1]+1
for w in range(W):
  for h in range(1,H):
    if G[h-1][w] == '.':
      A_d[h][w] = A_d[h-1][w]+1
  for h in range(H-2,-1,-1):
    if G[h+1][w] == '.':
      A_u[h][w] = A_u[h+1][w]+1
ans=0
for h in range(H):
  for w in range(W):
    if G[h][w] == '.':
      ans = max(ans,A_r[h][w]+A_l[h][w]+A_d[h][w]+A_u[h][w]+1)
print(ans)