fun main(args : Array<String>) {
    val (H, W) = readLine()!!.split(" ").map { it.toInt() }
    val map = Array(H, { CharArray(W)})
    (0..(H-1)).forEach { h ->
        val row = readLine()!!
        row.forEachIndexed{ w, char ->
            map[h][w] = char
        }
    }

    val infoRow = Array(H, { IntArray(W)})
    val infoColumn = Array(H, { IntArray(W)})

    (0..(H-1)).forEach { h ->
        var isCounting = false;
        var countingFrom = -1
        var countingTo = -1
        var counter = 0
        (0..(W-1)).forEach {w ->
            if (map[h][w] == '.') {
                if (!isCounting) {
                    counter = 1
                    isCounting = true
                    countingFrom = w
                    countingTo = w
                } else {
                    counter++
                    countingTo = w
                }
            }

            if (map[h][w] == '#') {
                if (!isCounting) {
                } else {
                    // Store the result
                    (countingFrom..countingTo).forEach {
                        infoRow[h][it] = counter
                    }
                    counter = 0
                    isCounting = false
                }
            }
        }
        if (isCounting) {
            (countingFrom..countingTo).forEach {
                infoRow[h][it] = counter
            }
        }
    }

    (0..(W-1)).forEach {w ->
        var isCounting = false;
        var countingFrom = -1
        var countingTo = -1
        var counter = 0
        (0..(H-1)).forEach { h ->
            if (map[h][w] == '.') {
                if (!isCounting) {
                    counter = 1
                    isCounting = true
                    countingFrom = h
                    countingTo = h
                } else {
                    counter++
                    countingTo = h
                }
            }

            if (map[h][w] == '#') {
                if (!isCounting) {
                } else {
                    // Store the result
                    (countingFrom..countingTo).forEach {
                        infoColumn[it][w] = counter
                    }
                    counter = 0
                    isCounting = false
                }
            }
        }
        if (isCounting) {
            (countingFrom..countingTo).forEach {
                infoColumn[it][w] = counter
            }
        }
    }


    var max = Int.MIN_VALUE
    (0..(H-1)).forEach { h ->
        (0..(W-1)).forEach {w ->
            if (map[h][w] != '#') {
                val count = infoRow[h][w] + infoColumn[h][w] - 1
                max = Math.max(max, count)
            }
        }
    }

    println(max)
}
