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