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