#include <bits/stdc++.h>
int main(void) {
  int N, K, n;
  int count = 1;
  scanf("%d", &N);
  scanf("%d", &K);
  n = N - K;
  while (n != 0) {
    n /= (K - 1);
    count++;
  }
  printf("%d", count);
  return 0;
}
