import java.util.Arrays; import java.util.LinkedList; import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); final int W = sc.nextInt(); final int D = sc.nextInt(); for(long day = D, work = W; day > 0; work -= work / (day * day), day--){ if(day == 1){ System.out.println(work); } } } }