import scala.io.StdIn

object Main extends App {
  val inputs1 = StdIn.readLine().split(" ")
  val H = inputs1(0).toInt
  val W = inputs1(1).toInt
  val Ss: Seq[Seq[String]] = for(_ <- 1 to H) yield {StdIn.readLine().toCharArray.map(_.toString).toSeq}

  val flattenSs = Ss.flatten

  val zahyo = for {
    x <- 1 to W
    y <- 1 to H
  } yield (x, y)

  def a(zahyos: List[(Int, Int)], accum: Int = 0): Int = zahyos match {
    case Nil => accum
    case head::tail => {
      val x = head._1
      val y = head._2
      val hjamas = Ss.map(e => e(x - 1))
      val height =
        hjamas.take(x - 1).reverse.takeWhile{e => e == "."}.size +
          hjamas.drop(x).takeWhile{e => e == "."}.size + 1

      val wjamas = Ss(y - 1)
      val weight =
        wjamas.take(y - 1).reverse.takeWhile{e => e == "."}.size +
          wjamas.drop(y).takeWhile{e => e == "."}.size + 1
      a(tail, Math.max(accum, height + weight - 1))
    }
  }
  println(a(zahyo.toList))
}