import java.io.*; import java.lang.*; import java.util.*; import java.math.*; public class Main { static Scanner cin = new Scanner(System.in); public static void main(String[] args) { int w=cin.nextInt(); int d=cin.nextInt(); for(int i=d; i>1; i--) w-=w/(i*i); System.out.println(w); } }