import java.util.Scanner; public class No51 { public static void main(String[] args) { Scanner s = new Scanner(System.in); double W = s.nextDouble() , D = s.nextDouble(); s.close(); for(int i = 0;i < D -1;i++){ double d2 = D - i; int w2 = (int)Math.floor(W/d2/d2); W -= w2; } System.out.println((int)W); } }