#include <bits/stdc++.h>
using namespace std;
int main() {
  double T, S, q;
  int m;
  double i = 0.0;
  cin >> T >> S >> q;
  m = 0;
  while (S < T) {
    while (i < S) {
      i += q / (q - 1);
      S++;
    }
    m++;
    i = 0.0;
  }
  cout << m;
  return 0;
}
