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