fun main(args: Array<String>) {
    val (H, W) = readLine()!!.split(" ").map(String::toInt)
    val map = Array(H) { i ->
        readLine()!!.toCharArray()
    }

    val mapL = mapL(map, H, W)
    val mapR = mapR(map, H, W)
    val mapD = mapD(map, H, W)
    val mapU = mapU(map, H, W)

    var max = 0
    for (h in 0 until H) {
        for (w in 0 until W) {
            if (map[h][w] == '#') {
                continue
            }
            val sum = mapL[h][w] + mapR[h][w] + mapU[h][w] + mapD[h][w] - 3
            max = Math.max(max, sum)
        }
    }
    println(max)
}

private fun mapL(map: Array<CharArray>, height: Int, width: Int): Array<IntArray> {
    val result = Array(height) { i -> IntArray(width) }
    for (h in 0 until height) {
        for (w in 0 until width) {
            if (map[h][w] == '#') {
                continue
            }
            if (w == 0) {
                result[h][w] = 1
            } else {
                result[h][w] = result[h][w - 1] + 1
            }
        }
    }
    return result
}

private fun mapR(map: Array<CharArray>, height: Int, width: Int): Array<IntArray> {
    val result = Array(height) { i -> IntArray(width) }
    for (h in (height - 1) downTo 0) {
        for (w in (width - 1) downTo 0) {
            if (map[h][w] == '#') {
                continue
            }
            if (w == width - 1) {
                result[h][w] = 1
            } else {
                result[h][w] = result[h][w + 1] + 1
            }
        }
    }
    return result
}

private fun mapD(map: Array<CharArray>, height: Int, width: Int): Array<IntArray> {
    val result = Array(height) { i -> IntArray(width) }
    for (h in 0 until height) {
        for (w in 0 until width) {
            if (map[h][w] == '#') {
                continue
            }
            if (h == 0) {
                result[h][w] = 1
            } else {
                result[h][w] = result[h - 1][w] + 1
            }
        }
    }
    return result
}

private fun mapU(map: Array<CharArray>, height: Int, width: Int): Array<IntArray> {
    val result = Array(height) { i -> IntArray(width) }
    for (h in (height - 1) downTo 0) {
        for (w in (width - 1) downTo 0) {
            if (map[h][w] == '#') {
                continue
            }
            if (h == height - 1) {
                result[h][w] = 1
            } else {
                result[h][w] = result[h + 1][w] + 1
            }
        }
    }
    return result
}
