fun main(args :Array<String>) {
    val (h, w) = readIntegerList()
    val map = arrayListOf<CharArray>()
    map.add(CharArray(w + 2) { '#' })
    for (i in 0 until h) {
        val row = readLine()!!
        map.add(('#' + row + '#').toCharArray())
    }
    map.add(CharArray(w + 2) { '#' })

    val countTop = Array<IntArray>(h + 2) { IntArray(w + 2) { 0 } }
    val countBottom = Array<IntArray>(h + 2) { IntArray(w + 2) { 0 } }
    for (i in 1..h) {
        for (j in 1..w) {
            countTop[i][j] = if (map[i][j] == '.') countTop[i - 1][j] + 1 else 0
            countBottom[h - i + 1][j] = if (map[h - i + 1][j] == '.') countBottom[h - i + 1 + 1][j] + 1 else 0
        }
    }

    val countLeft = Array<IntArray>(h + 2) { IntArray(w + 2) { 0 } }
    val countRight = Array<IntArray>(h + 2) { IntArray(w + 2) { 0 } }
    for (j in 1..w) {
        for (i in 1..h) {
            countLeft[i][j] = if (map[i][j] == '.') countLeft[i][j - 1] + 1 else 0
            countRight[i][w - j + 1] = if (map[i][w - j + 1] == '.') countRight[i][w - j + 1 + 1] + 1 else 0
        }
    }
    var ans = 0
    for (i in 1..h) {
        for (j in 1..w) {
            val sum = countTop[i][j] +
                countRight[i][j] +
                countBottom[i][j] +
                countLeft[i][j] -
                3
            ans = Math.max(ans, sum)
        }
    }
    println(ans)
}

fun readInteger() = readLine()!!.toInt()
fun readStringList() = readLine()!!.split(" ")
fun readIntegerList() = readStringList().map(String::toInt)
fun readLongList() = readStringList().map(String::toLong)
