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