#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, s, q, n = 0, ans = 0;
  bool end = true;
  cin >> t >> s >> q;
  while (end) {
    ans++;
    for (int i = 1; i <= s; n++, i++) {
      if (n % q == 0) s += q - 1;
      if (s >= t) {
        end = false;
        break;
      }
    }
  }
  cout << ans;
  return 0;
}
