import java.util.*; import java.io.*; public class Test{ public static void main(String[] args)throws Exception{ 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); } }