#include #include using namespace std; int main(){ int a,b; cin >> a >> b; for(; b>1;b--){ a-= a/b/b; } cout << a; return 0; }