#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, s, q, sum = 0, sum2 = 0;
  cin >> t >> s >> q;
  sum = s;
  while (t > s) {
    s--;
    sum = sum + q - 1;
    if (s == 0) {
      sum2++;
      s = sum;
    }
  }
  cout << sum2;
}
