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