#include using namespace std; int main() { int w,d; cin >> w >> d; for(long long i=d;i>1;i--){ w -= w/(i*i); } cout << w << endl; }