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)); int min=1000; int M=Integer.parseInt(br.readLine()); int N=Integer.parseInt(br.readLine()); int a=M/min; a/=N; a*=min; System.out.println(a); } }