h, w = gets.strip.split.map(&:to_i)
room = readlines.map {|line| line.strip.split('') }

v_illuminations = Array.new(w){ [] }
h_illuminations = Array.new(h){ [] }

room.each_with_index do |line, i|
  space_count = 0
  line.each_with_index do |space, j|
    if space == '#'
      h_illuminations[i] += [space_count]*space_count if space_count > 0
      h_illuminations[i] << 0
      space_count = 0
    end

    if space == '.'
      space_count += 1
      h_illuminations[i] += [space_count]*space_count if j == line.length-1
    end
  end
end

room.transpose.each_with_index do |line, i|
  space_count = 0
  line.each_with_index do |space, j|
    if space == '#'
      v_illuminations[i] += [space_count]*space_count if space_count > 0
      v_illuminations[i] << 0
      space_count = 0
    end

    if space == '.'
      space_count += 1
      v_illuminations[i] += [space_count]*space_count if j == line.length-1
    end
  end
end


result = 0
h.times do |i|
  w.times do |j|
    tmp_result = v_illuminations[j][i] + h_illuminations[i][j] - 1
    result = tmp_result if tmp_result > result
  end
end

p result
