import java.util.Scanner; public class No51 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long W = sc.nextInt(); long D = sc.nextInt(); while(D != 1) { W -= (W/(D*D)); D--; } System.out.println(W); } }