#include int main(){ int w,d;std::cin>>w>>d; for(int i=d;i>=2;i--){ w-=w/(i*i); } std::cout<