import java.io.*; // 処理 class Process { private long N; private int M; Process(long N, int M) { this.N = N; this.M = M; } long getResult() { return (((N / M) / 1000) * 1000); } } public class Main { public static void main(String[] args) throws IOException { var bufferedReader = new BufferedReader(new InputStreamReader(System.in)); var printWriter = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))); // 入力 long N = Long.parseLong(bufferedReader.readLine().trim()); int M = Integer.parseInt(bufferedReader.readLine().trim()); // 出力 printWriter.println((new Process(N, M)).getResult()); bufferedReader.close(); printWriter.close(); } }