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