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