class Calc0128 def initialize(args) args = args.map { |l| l.chomp.split(/\s+/) } @n = args.shift.first.to_i @m = args.shift.first.to_i end def run @n / 1000 / @m * 1000 end end puts Calc0128.new(STDIN.readlines).run if __FILE__ == $0