import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Tester2 { public static void main(String[] args) { try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) { long min = 1000; long M = Long.parseLong(br.readLine()); long N = Long.parseLong(br.readLine()); long a = M / min; a /= N; a *= min; System.out.println(a); } catch (IOException e) { e.printStackTrace(); } } }