import java.util.Arrays; import java.util.LinkedList; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); final long N = sc.nextLong(); final long M = sc.nextLong(); System.out.println(((N / M) / 1000) * 1000); } }