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