#include int main(void){ long w,d; std::cin>>w>>d; while(d>1) w-=w/(d*d),d--; std::cout<