import java.util.Scanner; public class Main { public static void main(String[] args) { try { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); int M = scan.nextInt(); int ans = N / M / 1000 * 1000; System.out.println(ans); scan.close(); } catch (Exception e) { e.printStackTrace(); } } }