import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class No00000128_Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); long n = Long.parseLong(br.readLine()); int m = Integer.parseInt(br.readLine()); System.out.println(((n / m) / 1000) * 1000); } }