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