import java.io.*; import java.util.*; import java.math.*; class Main128 { public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int m = Integer.parseInt(br.readLine()); int d = n / m; System.out.println(d - (d % 1000)); } }