import java.util.Scanner;
	

public class Main{
	
	
	public static void main(String args[])throws Exception{
		Scanner sc = new Scanner(System.in);

		long N = sc.nextLong();
		long M = sc.nextLong();
		System.out.println(N/1000/M*1000);
	}
	

}