import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import static java.lang.System.in; import static java.lang.System.setOut; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(in)); int N = Integer.parseInt(reader.readLine()); int M = Integer.parseInt(reader.readLine()); findMaximunOtosidama(N, M); } private static void findMaximunOtosidama(int N, int M) { int lo = 1; int hi = 10000; while (lo < hi) { int mid = lo + (hi-lo+1) / 2; if (isFeasible(N, M, mid)) { lo = mid; } else { hi = mid - 1; } } System.out.println((lo/1000)*1000); } private static boolean isFeasible(int N, int M, int money) { return money * M <= N; } }