def solve():
  ans = 0
  H, W = map(int, input().split())
  S = [0]*(H+2)
  S[0] = '*'*(W+2)
  S[H+1] = '*'*(W+2)
  for h in range(1,H+1):
    S[h] = '*' + input() + '*'
  L = [[0]*(W+2) for _ in range(H+2)]
  R = [[0]*(W+2) for _ in range(H+2)]
  U = [[0]*(W+2) for _ in range(H+2)]
  D = [[0]*(W+2) for _ in range(H+2)]
  for h in range(1,H+2):
    for w in range(1,W+2):
      if S[h][w]=='.':
        if S[h][w-1]=='.':
          L[h][w] = L[h][w-1]+1
        if S[h-1][w]=='.':
          U[h][w] = U[h-1][w]+1
  for h in range(H+1,0,-1):
    for w in range(W+1,0,-1):
      if S[h][w]=='.':
        if S[h][w+1]=='.':
          R[h][w] = R[h][w+1]+1
        if S[h+1][w]=='.':
          D[h][w] = D[h+1][w]+1
  total = [[0]*(W+2) for _ in range(H+2)]
  for h in range(1,H+2):
    for w in range(1,W+2):
      if S[h][w]=='.':
        total[h][w] = L[h][w]+R[h][w]+U[h][w]+D[h][w]+1
        ans = max(ans,total[h][w])
  return ans
print(solve()) def solve():
  ans = 0
  H, W = map(int, input().split())
  S = [0]*(H+2)
  S[0] = '*'*(W+2)
  S[H+1] = '*'*(W+2)
  for h in range(1,H+1):
    S[h] = '*' + input() + '*'
  L = [[0]*(W+2) for _ in range(H+2)]
  R = [[0]*(W+2) for _ in range(H+2)]
  U = [[0]*(W+2) for _ in range(H+2)]
  D = [[0]*(W+2) for _ in range(H+2)]
  for h in range(1,H+2):
    for w in range(1,W+2):
      if S[h][w]=='.':
        if S[h][w-1]=='.':
          L[h][w] = L[h][w-1]+1
        if S[h-1][w]=='.':
          U[h][w] = U[h-1][w]+1
  for h in range(H+1,0,-1):
    for w in range(W+1,0,-1):
      if S[h][w]=='.':
        if S[h][w+1]=='.':
          R[h][w] = R[h][w+1]+1
        if S[h+1][w]=='.':
          D[h][w] = D[h+1][w]+1
  total = [[0]*(W+2) for _ in range(H+2)]
  for h in range(1,H+2):
    for w in range(1,W+2):
      if S[h][w]=='.':
        total[h][w] = L[h][w]+R[h][w]+U[h][w]+D[h][w]+1
        ans = max(ans,total[h][w])
  return ans solve ans = 0 ans 0 H, W = map(int, input().split()) H map(int, input().split()) map int input().split() ().split () input split W S = [0]*(H+2) S [0]*(H+2) [0] 0 H+2 H 2 S[0] = '*'*(W+2) S[0] S 0 '*'*(W+2) '*' W+2 W 2 S[H+1] = '*'*(W+2) S[H+1] S H+1 H 1 '*'*(W+2) '*' W+2 W 2 for h in range(1,H+1):
    S[h] = '*' + input() + '*'
   h range(1,H+1) range 1 H+1 H 1 S[h] = '*' + input() + '*' S[h] S h '*' + input() + '*' '*' + input() '*' input() input '*' [0]*(W+2) for _ in range(H+2) for _ in range(H+2) _ range(H+2) range H+2 H 2 for _ in range(H+2) [0]*(W+2) [0] 0 W+2 W 2 L = [[0]*(W+2) for _ in range(H+2)] L [[0]*(W+2) for _ in range(H+2)] [0]*(W+2) for _ in range(H+2) for _ in range(H+2) _ range(H+2) range H+2 H 2 for _ in range(H+2) [0]*(W+2) [0] 0 W+2 W 2 R = [[0]*(W+2) for _ in range(H+2)] R [[0]*(W+2) for _ in range(H+2)] [0]*(W+2) for _ in range(H+2) for _ in range(H+2) _ range(H+2) range H+2 H 2 for _ in range(H+2) [0]*(W+2) [0] 0 W+2 W 2 U = [[0]*(W+2) for _ in range(H+2)] U [[0]*(W+2) for _ in range(H+2)] [0]*(W+2) for _ in range(H+2) for _ in range(H+2) _ range(H+2) range H+2 H 2 for _ in range(H+2) [0]*(W+2) [0] 0 W+2 W 2 D = [[0]*(W+2) for _ in range(H+2)] D [[0]*(W+2) for _ in range(H+2)] for h in range(1,H+2):
    for w in range(1,W+2):
      if S[h][w]=='.':
        if S[h][w-1]=='.':
          L[h][w] = L[h][w-1]+1
        if S[h-1][w]=='.':
          U[h][w] = U[h-1][w]+1
   h range(1,H+2) range 1 H+2 H 2 for w in range(1,W+2):
      if S[h][w]=='.':
        if S[h][w-1]=='.':
          L[h][w] = L[h][w-1]+1
        if S[h-1][w]=='.':
          U[h][w] = U[h-1][w]+1
   w range(1,W+2) range 1 W+2 W 2 if S[h][w]=='.':
        if S[h][w-1]=='.':
          L[h][w] = L[h][w-1]+1
        if S[h-1][w]=='.':
          U[h][w] = U[h-1][w]+1
   S[h][w]=='.' S[h][w] [h] S h w '.' if S[h][w-1]=='.':
          L[h][w] = L[h][w-1]+1
         S[h][w-1]=='.' S[h][w-1] [h] S h w-1 w 1 '.' L[h][w] = L[h][w-1]+1 L[h][w] [h] L h w L[h][w-1]+1 L[h][w-1] [h] L h w-1 w 1 1 if S[h-1][w]=='.':
          U[h][w] = U[h-1][w]+1
   S[h-1][w]=='.' S[h-1][w] [h-1] S h-1 h 1 w '.' U[h][w] = U[h-1][w]+1 U[h][w] [h] U h w U[h-1][w]+1 U[h-1][w] [h-1] U h-1 h 1 w 1 for h in range(H+1,0,-1):
    for w in range(W+1,0,-1):
      if S[h][w]=='.':
        if S[h][w+1]=='.':
          R[h][w] = R[h][w+1]+1
        if S[h+1][w]=='.':
          D[h][w] = D[h+1][w]+1
   h range(H+1,0,-1) range H+1 H 1 0 -1 for w in range(W+1,0,-1):
      if S[h][w]=='.':
        if S[h][w+1]=='.':
          R[h][w] = R[h][w+1]+1
        if S[h+1][w]=='.':
          D[h][w] = D[h+1][w]+1
   w range(W+1,0,-1) range W+1 W 1 0 -1 if S[h][w]=='.':
        if S[h][w+1]=='.':
          R[h][w] = R[h][w+1]+1
        if S[h+1][w]=='.':
          D[h][w] = D[h+1][w]+1
   S[h][w]=='.' S[h][w] [h] S h w '.' if S[h][w+1]=='.':
          R[h][w] = R[h][w+1]+1
         S[h][w+1]=='.' S[h][w+1] [h] S h w+1 w 1 '.' R[h][w] = R[h][w+1]+1 R[h][w] [h] R h w R[h][w+1]+1 R[h][w+1] [h] R h w+1 w 1 1 if S[h+1][w]=='.':
          D[h][w] = D[h+1][w]+1
   S[h+1][w]=='.' S[h+1][w] [h+1] S h+1 h 1 w '.' D[h][w] = D[h+1][w]+1 D[h][w] [h] D h w D[h+1][w]+1 D[h+1][w] [h+1] D h+1 h 1 w 1 [0]*(W+2) for _ in range(H+2) for _ in range(H+2) _ range(H+2) range H+2 H 2 for _ in range(H+2) [0]*(W+2) [0] 0 W+2 W 2 total = [[0]*(W+2) for _ in range(H+2)] total [[0]*(W+2) for _ in range(H+2)] for h in range(1,H+2):
    for w in range(1,W+2):
      if S[h][w]=='.':
        total[h][w] = L[h][w]+R[h][w]+U[h][w]+D[h][w]+1
        ans = max(ans,total[h][w])
   h range(1,H+2) range 1 H+2 H 2 for w in range(1,W+2):
      if S[h][w]=='.':
        total[h][w] = L[h][w]+R[h][w]+U[h][w]+D[h][w]+1
        ans = max(ans,total[h][w])
   w range(1,W+2) range 1 W+2 W 2 if S[h][w]=='.':
        total[h][w] = L[h][w]+R[h][w]+U[h][w]+D[h][w]+1
        ans = max(ans,total[h][w])
   S[h][w]=='.' S[h][w] [h] S h w '.' total[h][w] = L[h][w]+R[h][w]+U[h][w]+D[h][w]+1 total[h][w] [h] total h w L[h][w]+R[h][w]+U[h][w]+D[h][w]+1 L[h][w]+R[h][w]+U[h][w]+D[h][w] L[h][w]+R[h][w]+U[h][w] L[h][w]+R[h][w] L[h][w] [h] L h w R[h][w] [h] R h w U[h][w] [h] U h w D[h][w] [h] D h w 1 ans = max(ans,total[h][w]) ans max(ans,total[h][w]) max ans total[h][w] [h] total h w return ans ans print(solve()) print solve() solve def solve():
  ans = 0
  H, W = map(int, input().split())
  S = [0]*(H+2)
  S[0] = '*'*(W+2)
  S[H+1] = '*'*(W+2)
  for h in range(1,H+1):
    S[h] = '*' + input() + '*'
  L = [[0]*(W+2) for _ in range(H+2)]
  R = [[0]*(W+2) for _ in range(H+2)]
  U = [[0]*(W+2) for _ in range(H+2)]
  D = [[0]*(W+2) for _ in range(H+2)]
  for h in range(1,H+2):
    for w in range(1,W+2):
      if S[h][w]=='.':
        if S[h][w-1]=='.':
          L[h][w] = L[h][w-1]+1
        if S[h-1][w]=='.':
          U[h][w] = U[h-1][w]+1
  for h in range(H+1,0,-1):
    for w in range(W+1,0,-1):
      if S[h][w]=='.':
        if S[h][w+1]=='.':
          R[h][w] = R[h][w+1]+1
        if S[h+1][w]=='.':
          D[h][w] = D[h+1][w]+1
  total = [[0]*(W+2) for _ in range(H+2)]
  for h in range(1,H+2):
    for w in range(1,W+2):
      if S[h][w]=='.':
        total[h][w] = L[h][w]+R[h][w]+U[h][w]+D[h][w]+1
        ans = max(ans,total[h][w])
  return ans def solve():
  ans = 0
  H, W = map(int, input().split())
  S = [0]*(H+2)
  S[0] = '*'*(W+2)
  S[H+1] = '*'*(W+2)
  for h in range(1,H+1):
    S[h] = '*' + input() + '*'
  L = [[0]*(W+2) for _ in range(H+2)]
  R = [[0]*(W+2) for _ in range(H+2)]
  U = [[0]*(W+2) for _ in range(H+2)]
  D = [[0]*(W+2) for _ in range(H+2)]
  for h in range(1,H+2):
    for w in range(1,W+2):
      if S[h][w]=='.':
        if S[h][w-1]=='.':
          L[h][w] = L[h][w-1]+1
        if S[h-1][w]=='.':
          U[h][w] = U[h-1][w]+1
  for h in range(H+1,0,-1):
    for w in range(W+1,0,-1):
      if S[h][w]=='.':
        if S[h][w+1]=='.':
          R[h][w] = R[h][w+1]+1
        if S[h+1][w]=='.':
          D[h][w] = D[h+1][w]+1
  total = [[0]*(W+2) for _ in range(H+2)]
  for h in range(1,H+2):
    for w in range(1,W+2):
      if S[h][w]=='.':
        total[h][w] = L[h][w]+R[h][w]+U[h][w]+D[h][w]+1
        ans = max(ans,total[h][w])
  return ans solve
def solve():
  ans = 0
  H, W = map(int, input().split())
  S = [0]*(H+2)
  S[0] = '*'*(W+2)
  S[H+1] = '*'*(W+2)
  for h in range(1,H+1):
    S[h] = '*' + input() + '*'
  L = [[0]*(W+2) for _ in range(H+2)]
  R = [[0]*(W+2) for _ in range(H+2)]
  U = [[0]*(W+2) for _ in range(H+2)]
  D = [[0]*(W+2) for _ in range(H+2)]
  for h in range(1,H+2):
    for w in range(1,W+2):
      if S[h][w]=='.':
        if S[h][w-1]=='.':
          L[h][w] = L[h][w-1]+1
        if S[h-1][w]=='.':
          U[h][w] = U[h-1][w]+1
  for h in range(H+1,0,-1):
    for w in range(W+1,0,-1):
      if S[h][w]=='.':
        if S[h][w+1]=='.':
          R[h][w] = R[h][w+1]+1
        if S[h+1][w]=='.':
          D[h][w] = D[h+1][w]+1
  total = [[0]*(W+2) for _ in range(H+2)]
  for h in range(1,H+2):
    for w in range(1,W+2):
      if S[h][w]=='.':
        total[h][w] = L[h][w]+R[h][w]+U[h][w]+D[h][w]+1
        ans = max(ans,total[h][w])
  return ans
print(solve())