class Node {
  var val: Int
  var next: Node?
  init(_ v: Int) {
    self.val = v
  }
}
class Stack {
  var head: Node?
  
  var isEmpty: Bool { return head == nil }
  
  func push(_ v: Int) {
    let node = Node(v)
    node.next = head
    head = node
  }
  func pop() -> Int {
    let v = head!.val
    let tmp = head
    head = head?.next
    tmp?.next = nil
    return v
  }
}


let inp = readLine()!.split(separator: " ").map { Int($0)! }
let h = inp[0]
let w = inp[1]
var grid: [[Character]] = .init(repeating: [], count: h)

var memo: [[Int]] = .init(repeating: .init(repeating: 0, count: w), count: h)

for i in 0..<h {
  grid[i] = Array(readLine()!)
}

let stack = Stack()

var curSum = 0

for row in 0..<h {
  curSum = 0
  for col in 0..<w {
    if grid[row][col] == "#" {
      while !stack.isEmpty {
        let v = stack.pop()
        let r = v / w
        let c = v % w
        memo[r][c] += curSum
      }
      curSum = 0
    } else {
      curSum += 1
      let index = row * w + col
      stack.push(index)
    }
  }
  while !stack.isEmpty {
	let v = stack.pop()
   	let r = v / w
   	let c = v % w
  	memo[r][c] += curSum
  }
}


var ans = 0

for col in 0..<w {
  curSum = 0
  for row in 0..<h {
    if grid[row][col] == "#" {
      while !stack.isEmpty {
        let v = stack.pop()
        let r = v / w
        let c = v % w
        memo[r][c] += curSum
        ans = max(ans, memo[r][c])
      }
      curSum = 0
    } else {
      curSum += 1
      let index = row * w + col
      stack.push(index)
    }
  }
  while !stack.isEmpty {
	let v = stack.pop()
   	let r = v / w
   	let c = v % w
  	memo[r][c] += curSum
  	ans = max(ans, memo[r][c])
  }
}

print(max(ans - 1, 0))