#include int work(int w, int d) { return ((d==1)?w:work(w-w/d^2,d-1)); } int main() { int w,d; std::cin >> w >> d; std::cout << work(w,d) << std::endl; }