#include int main(void) { long long w,d; int i; scanf("%lld%lld",&w,&d); for(d;d-1>0;d--){ w-=w/(d*d); } printf("%lld\n",w); return 0; }