import java.util.Scanner; class No_128 { public static void main(String args[]) { Scanner stdIn = new Scanner(System.in); long budget = stdIn.nextLong(); long persons = stdIn.nextLong(); long money = (budget / 1000) / persons * 1000; System.out.println(money); } }