import java.util.Scanner; public class yukicoder_128 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); long n = scanner.nextLong(); long m = scanner.nextLong(); long a = n / m / 1000; long money = a * 1000; if (money < 1000) { money = 0; } System.out.println(money); } }