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