#include using namespace std; using Int = long long; //INSERT ABOVE HERE signed main(){ Int w,d; cin>>w>>d; for(Int i=d;i>1;i--) w-=w/(i*i); cout<