#include <iostream>
#include <cmath>
using namespace std;
int main() {
double l, k;
cin >> l >> k;
const double c = 1e-5; //вводим константу
cout << (int) log (l - c) / log (k);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCWRvdWJsZSBsLCBrOwoJY2luID4+IGwgPj4gazsKCWNvbnN0IGRvdWJsZSBjID0gMWUtNTsgLy/QstCy0L7QtNC40Lwg0LrQvtC90YHRgtCw0L3RgtGDIAoJY291dCA8PCAoaW50KSBsb2cgKGwgLSBjKSAvIGxvZyAoayk7CglyZXR1cm4gMDsKfQ==