#include #include #include using namespace std; using mint=atcoder::modint998244353; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); long N,P; cin>>N>>P; long e=0; while(N>=P) { e+=N/=P; } cout<