import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader reader =new BufferedReader(new InputStreamReader(System.in)); int W = Integer.parseInt(reader.readLine()); int D = Integer.parseInt(reader.readLine()); for (int i = D; i > 1 ; i--) { W = W - W/(i*i); } System.out.println(W); } }