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