#!/bin/ruby N = gets.chomp.to_i M = gets.chomp.to_i k = 0 while N >= (M * (k + 1) * 1000) k += 1 end puts k * 1000