import java.util.*; public class Exercise99{ public static void main (String[] args){ Scanner sc = new Scanner(System.in); long n = sc.nextLong(); int m = sc.nextInt(); System.out.println((n / 1000) / m * 1000); } }