#include #include #include #include #include #include //--------------------------- using namespace std; //--------------------------- #define REP(i,n) for(int i = 0; i < (n); i++) #define P(x) cout << (x) << "\n" //--------------------------- int main(){ std::ios::sync_with_stdio(false); std::cin.tie(0); int w,d;cin >> w >> d; for (int i = d; i > 1; i--) { w = w - floor(w / pow(i,2)); } P(w); return 0; }