h, w = gets.chomp.split(' ').map(&:to_i)
h_light_nums = Array.new(w, 0)
h_current_max = Array.new(w, 0)
h_current_max_updating = Array.new(w, false)

h.times do
  str = gets.chomp
  index = 0
  light_row = 0
  w_light_nums = []

  str.each_char do |ch|
    if ch == '.'
      light_row += 1
      h_light_nums[index] += 1
      h_current_max[index] += 1 if h_current_max_updating[index]
    else
      h_light_nums[index] = 0
      h_current_max_updating[index] = false
      w_light_nums.concat([light_row] * light_row).push(0)
      light_row = 0
    end
    index += 1
  end
  w_light_nums.concat([light_row] * light_row)

  index = 0
  w_light_nums.each do |w_light_num|
    num = w_light_num + h_light_nums[index] - 1
    if num >= h_current_max[index]
      h_current_max[index] = num
      h_current_max_updating[index] = true
    end
    index += 1
  end
end

p h_current_max.max
