import java.util.*; public class Main { public static void main(String[] args) { // 標準入力を受け取る Scanner sc = new Scanner(System.in); int w = sc.nextInt(); int d = sc.nextInt(); int[] amount = new int[d]; for(int i = 0; i < d; i++) { amount[i] = w / ((d-i)*(d-i)); w = w - amount[i]; } System.out.println(amount[d-1]); } }