#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <typename... t>
using V = vector<t...>;
template <typename t>
void print(ostream& os, const t& a) {
  os << a << '\n';
}
template <typename t, typename... v>
void print(ostream& os, const t& a, v&&... b) {
  os << a << ' ';
  print(os, b...);
}
int n, k;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> k;
  if (n == k) return print(cout, 1), 0;
  --k;
  print(cout, (n + k - 1) / k);
}
