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