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