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