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

m = [[0 for i in range(W)] for j in range(H)]
#yoko
for i in range(H):
  s = S[i]
  mar = 0
  cnt = 0
  for j in range(W):
    if s[j] == ".":
      cnt += 1
    if s[j] == "#":
      for k in range(mar,j):
        m[i][k] += cnt
      cnt = 0
      mar = j+1    
    #グリッドの端の処理
    if j == W-1 and s[j] == ".":
      for k in range(mar,j+1):
        m[i][k] += cnt


#tate      
for i in range(W):
  mar = 0
  cnt = 0
  for j in range(H):
    if S[j][i] == ".":
      cnt += 1
    if S[j][i] == "#":
      for k in range(mar,j):
        m[k][i] += cnt
      cnt = 0
      mar = j+1 
    #グリッドの端の処理
    if j == H-1 and S[j][i] == ".":
      for k in range(mar,j+1):
        m[k][i] += cnt


ans = 0
for i in range(H):
  ans = max(ans,max(m[i]))
print(ans-1)   H,W = map(int,input().split()) H map(int,input().split()) map int input().split() ().split () input split W S = [] S [] for i in range(H):
  S.append(input()) i range(H) range H S.append(input()) S.append S append input() input [0 for i in range(W)] for j in range(H) for j in range(H) j range(H) range H for j in range(H) [0 for i in range(W)] m = [[0 for i in range(W)] for j in range(H)] m [[0 for i in range(W)] for j in range(H)] for i in range(H):
  s = S[i]
  mar = 0
  cnt = 0
  for j in range(W):
    if s[j] == ".":
      cnt += 1
    if s[j] == "#":
      for k in range(mar,j):
        m[i][k] += cnt
      cnt = 0
      mar = j+1    
    #グリッドの端の処理
    if j == W-1 and s[j] == ".":
      for k in range(mar,j+1):
        m[i][k] += cnt


#tate       i range(H) range H s = S[i] s S[i] S i mar = 0 mar 0 cnt = 0 cnt 0 for j in range(W):
    if s[j] == ".":
      cnt += 1
    if s[j] == "#":
      for k in range(mar,j):
        m[i][k] += cnt
      cnt = 0
      mar = j+1    
    #グリッドの端の処理
    if j == W-1 and s[j] == ".":
      for k in range(mar,j+1):
        m[i][k] += cnt


#tate       j range(W) range W if s[j] == ".":
      cnt += 1
     s[j] == "." s[j] s j "." cnt += 1 cnt 1 if s[j] == "#":
      for k in range(mar,j):
        m[i][k] += cnt
      cnt = 0
      mar = j+1    
    #グリッドの端の処理
     s[j] == "#" s[j] s j "#" for k in range(mar,j):
        m[i][k] += cnt
       k range(mar,j) range mar j m[i][k] += cnt m[i][k] [i] m i k cnt cnt = 0 cnt 0 mar = j+1 mar j+1 j 1 if j == W-1 and s[j] == ".":
      for k in range(mar,j+1):
        m[i][k] += cnt


#tate       j == W-1 and s[j] == "." j == W-1 j W-1 W 1 s[j] == "." s[j] s j "." for k in range(mar,j+1):
        m[i][k] += cnt


#tate       k range(mar,j+1) range mar j+1 j 1 m[i][k] += cnt m[i][k] [i] m i k cnt for i in range(W):
  mar = 0
  cnt = 0
  for j in range(H):
    if S[j][i] == ".":
      cnt += 1
    if S[j][i] == "#":
      for k in range(mar,j):
        m[k][i] += cnt
      cnt = 0
      mar = j+1 
    #グリッドの端の処理
    if j == H-1 and S[j][i] == ".":
      for k in range(mar,j+1):
        m[k][i] += cnt i range(W) range W mar = 0 mar 0 cnt = 0 cnt 0 for j in range(H):
    if S[j][i] == ".":
      cnt += 1
    if S[j][i] == "#":
      for k in range(mar,j):
        m[k][i] += cnt
      cnt = 0
      mar = j+1 
    #グリッドの端の処理
    if j == H-1 and S[j][i] == ".":
      for k in range(mar,j+1):
        m[k][i] += cnt j range(H) range H if S[j][i] == ".":
      cnt += 1
     S[j][i] == "." S[j][i] [j] S j i "." cnt += 1 cnt 1 if S[j][i] == "#":
      for k in range(mar,j):
        m[k][i] += cnt
      cnt = 0
      mar = j+1 
    #グリッドの端の処理
     S[j][i] == "#" S[j][i] [j] S j i "#" for k in range(mar,j):
        m[k][i] += cnt
       k range(mar,j) range mar j m[k][i] += cnt m[k][i] [k] m k i cnt cnt = 0 cnt 0 mar = j+1 mar j+1 j 1 if j == H-1 and S[j][i] == ".":
      for k in range(mar,j+1):
        m[k][i] += cnt j == H-1 and S[j][i] == "." j == H-1 j H-1 H 1 S[j][i] == "." S[j][i] [j] S j i "." for k in range(mar,j+1):
        m[k][i] += cnt k range(mar,j+1) range mar j+1 j 1 m[k][i] += cnt m[k][i] [k] m k i cnt ans = 0 ans 0 for i in range(H):
  ans = max(ans,max(m[i])) i range(H) range H ans = max(ans,max(m[i])) ans max(ans,max(m[i])) max ans max(m[i]) max m[i] m i print(ans-1) print ans-1 ans 1 mar = 0 0 mar H,W = map(int,input().split()) map(int,input().split()) H mar = 0 0 mar W = map(int,input().split()) map(int,input().split()) W cnt += 1 1 cnt mar = j+1 j+1 mar cnt += 1 1 cnt cnt = 0 0 cnt s = S[i] S[i] s ans = max(ans,max(m[i])) max(ans,max(m[i])) ans cnt = 0 0 cnt cnt = 0 0 cnt ans = 0 0 ans mar = j+1 j+1 mar S = [] [] S m = [[0 for i in range(W)] for j in range(H)] [[0 for i in range(W)] for j in range(H)] m cnt = 0 0 cnt
H,W = map(int,input().split())
S = []
for i in range(H):
  S.append(input())

m = [[0 for i in range(W)] for j in range(H)]
#yoko
for i in range(H):
  s = S[i]
  mar = 0
  cnt = 0
  for j in range(W):
    if s[j] == ".":
      cnt += 1
    if s[j] == "#":
      for k in range(mar,j):
        m[i][k] += cnt
      cnt = 0
      mar = j+1    
    #グリッドの端の処理
    if j == W-1 and s[j] == ".":
      for k in range(mar,j+1):
        m[i][k] += cnt


#tate      
for i in range(W):
  mar = 0
  cnt = 0
  for j in range(H):
    if S[j][i] == ".":
      cnt += 1
    if S[j][i] == "#":
      for k in range(mar,j):
        m[k][i] += cnt
      cnt = 0
      mar = j+1 
    #グリッドの端の処理
    if j == H-1 and S[j][i] == ".":
      for k in range(mar,j+1):
        m[k][i] += cnt


ans = 0
for i in range(H):
  ans = max(ans,max(m[i]))
print(ans-1)  