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

    val S = Array(H + 2) {
        if (it == 0 || it == H + 1) {
            String(CharArray(W + 2) {'#'} )
        } else {
            "#" + readLine()!! + "#"
        }
    }

    val h = Array(H + 2) { LongArray(W + 2) {0L} }
    val v = Array(H + 2) { LongArray(W + 2) {0L} }

    for (i in 1..H) for(j in 1..W) {
        if (S[i][j] == '.') {
            h[i][j] = h[i][j - 1] + 1
            v[i][j] = v[i - 1][j] + 1
        }
    }

    for (i in H downTo 1) for (j in W downTo 1) {
        if (S[i][j] == '.') {
            h[i][j] = Math.max(h[i][j], h[i][j + 1])
            v[i][j] = Math.max(v[i][j], v[i + 1][j])
        }
    }

    var r = 0L
    for (i in 1..H) for (j in 1..W) {
        if (S[i][j] == '.') {
            r = Math.max(r, h[i][j] + v[i][j] - 1)
        }
    }
    println(r)
}
