import java.util.Scanner; class No_51 { public static void main(String args[]) { Scanner stdIn = new Scanner(System.in); int work = stdIn.nextInt(); int day = stdIn.nextInt(); double tmp; while ( day != 1 ) { tmp = work / Math.pow(day, 2); day -= 1; work -= Math.floor(tmp); } System.out.println(work); } }