#include using namespace std; signed main(){ int W, D; cin >> W >> D; for( int i = D; i >= 2; --i ){ W -= 1LL * W / ( 1LL * i * i ); } cout << W << endl; return 0; }