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