def main
    h, w = gets.split.map(&:to_i)
    s = $<.map(&:bytes).flatten

    ww = w+1
    mx = (h+1)*(w+1)

    dph = Array.new(mx, 0)
    dpw = Array.new(mx, 0)

    (h*ww-1).downto(0) do |i|
        if s[i] == 46
            dph[i] = dph[i+ww] + 1
            dpw[i] = dpw[i+1] + 1
        end
    end

    ans = 0
    (h*ww).times do |i|
        if s[i] == 46
            dph[i+ww] = dph[i]
            dpw[i+1] = dpw[i]
            res = dph[i] + dpw[i] - 1
            ans = res if ans < res
        end
    end
    puts ans
end

main