#include <bits/stdc++.h>
using namespace std;
int main() {
  double s, q, time;
  int iter, t, recur, dlded;
  cin >> t >> s >> q;
  iter = 1;
  time = 1;
  recur = 0;
  while (iter != t) {
    if (iter < s) {
      iter++;
      time++;
    } else {
      dlded = s + (time + 1) * (q - 1) / q;
      if (dlded >= iter + 1) {
        iter++;
        time++;
      } else {
        recur++;
        iter = 1;
        time++;
      }
    }
  }
  cout << recur + 1 << "\n";
  return 0;
}
