#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t, s, q, curr = 0, down, x = 1;
  cin >> t >> s >> q;
  down = s;
  while (curr <= t - 1) {
    if (curr != down) {
      curr += q;
      down += q - 1;
    } else {
      x++;
      curr = q;
      down += q - 1;
    }
  }
  cout << x;
  return 0;
}
