n, m = 2.times.map{gets.to_i} puts n / 1000 / m * 1000