fun main(args: Array<String>) {
    val sc = java.util.Scanner(System.`in`)
    val h = sc.nextInt()
    val w = sc.nextInt()
    val a: List<IntArray> = sc.asSequence().take(h).map { it.toCharArray().map { c -> if (c == '#') -1 else 0 }.toIntArray() }.toList()

    for (y in 0 until a.size) {
        var x0 = 0
        var x1 = -1
        for (x in 0 until a[y].size) {
            if (a[y][x] == -1) {
                val d = x1 - x0 + 1
                if (d > 0) {
                    for (j in x0..x1) {
                        a[y][j] = d
                    }
                }
                x0 = x + 1
            } else {
                x1 = x
            }
        }
        x1 = a[y].size - 1
        val d = x1 - x0 + 1
        if (d > 0) {
            for (j in x0..x1) {
                a[y][j] = d
            }
        }
    }

    for (x in 0 until w) {
        var y0 = 0
        var y1 = -1
        for (y in 0 until h) {
            if (a[y][x] == -1) {
                val d = y1 - y0 + 1
                if (d > 0) {
                    for (j in y0..y1) {
                        a[j][x] += d
                    }
                }
                y0 = y + 1
            } else {
                y1 = y
            }
        }
        y1 = h - 1
        val d = y1 - y0 + 1
        if (d > 0) {
            for (j in y0..y1) {
                a[j][x] += d
            }
        }
    }

    var r = a.map { it.max() }.maxBy { it ?: 1 } ?: 1
    if (r == -1) r = 1

    println(r - 1)
}
