import java.util.Scanner; public class no52{ public static void main(String... args){ Scanner scan = new Scanner(System.in); int w = scan.nextInt(); int d = scan.nextInt(); while(d != 1){ w -= (w/(d*d)); d--; } System.out.println(w); } }