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