n = gets.chomp.to_i m = gets.chomp.to_i p (n.to_f / m / 1000).floor * 1000