#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t, s, q;
  cin >> t >> s >> q;
  long long x = 0, y = 0;
  long long ans = 0;
  x = s;
  while (x < t) {
    while (x > y) {
      x += q - 1;
      y += q;
    }
    ans++;
    y = 0;
  }
  cout << ans;
}
