using System;
using System.Globalization;
using System.IO;
using System.Runtime.CompilerServices;
using System.Text;
using static System.Math;
using static Scanner;

class Solver
{
    private const int BUFFER_SIZE = 4096;
    static void Main(string[] args) {
        Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
        Solve();
        Console.Out.Flush();
    }

    static void Solve() {
        Span<byte> buf = stackalloc byte[BUFFER_SIZE];
        var sc = new Scanner(Console.OpenStandardInput(), ref buf);
        var (N, K) = sc.Dual<int>();
        N -= K;
        var answer = 1;
        while (N > 0) {
            N -= K - 1;
            answer++;
        }
        Console.WriteLine(answer);
    }
}

public ref struct Scanner
{
    const int BEGIN = 33, END = 126, ZERO = 48, NINE = 57;
    readonly Stream stdin;
    readonly Span<byte> buffer;
    int size, p;
    bool isComplete;
    [MethodImpl(256)] public Scanner(Stream stream, ref Span<byte> buf) { stdin = stream; buffer = buf; size = 0; p = 0; isComplete = false; }
    [MethodImpl(256)]
    private byte Rd() {
        if (isComplete) return default;
        if (p < size) return buffer[p++];
        p = 0;
        if ((size = stdin.Read(buffer)) > 0) return buffer[p++];
        isComplete = true;
        return 0;
    }
    [MethodImpl(256)]
    private char Next() {
        byte b;
        do b = Rd();
        while (b < BEGIN || END < b);
        return (char) b;
    }
    [MethodImpl(256)]
    private string Str() {
        var sb = new StringBuilder();
        for (var c = Next(); BEGIN <= c && c <= END; c = (char) Rd()) sb.Append(c);
        return sb.ToString();
    }
    [MethodImpl(256)]
    private int Int() {
        int tmp = 0;
        for (var c = Next(); ZERO <= c && c <= NINE; c = (char) Rd()) tmp = tmp * 10 + c - ZERO;
        return tmp;
    }
    [MethodImpl(256)]
    private long Long() {
        long tmp = 0;
        for (var c = Next(); ZERO <= c && c <= NINE; c = (char) Rd()) tmp = tmp * 10 + c - ZERO;
        return tmp;
    }
    [MethodImpl(256)]
    private double Double() => double.Parse(Str(), CultureInfo.InvariantCulture);
    [MethodImpl(256)]
    public string ScanStrLine() {
        var sb = new StringBuilder();
        for (var c = Next(); c != '\n' && c != 0; c = (char) Rd()) if (c != '\r') sb.Append(c);
        return sb.ToString();
    }
    [MethodImpl(256)]
    public T Scan<T>() {
        if (typeof(T) == typeof(int))    { var i = Int();    return Unsafe.As<int, T>   (ref i); }
        if (typeof(T) == typeof(long))   { var l = Long();   return Unsafe.As<long, T>  (ref l); }
        if (typeof(T) == typeof(string)) { var s = Str();    return Unsafe.As<string, T>(ref s); }
        if (typeof(T) == typeof(double)) { var d = Double(); return Unsafe.As<double, T>(ref d); }
        return default;
    }
    [MethodImpl(256)] public (T, T) Dual<T>() => (Scan<T>(), Scan<T>());
    [MethodImpl(256)] public (T, T, T) Tri<T>() => (Scan<T>(), Scan<T>(), Scan<T>());
    [MethodImpl(256)] public (T, T, T, T) Quad<T>() => (Scan<T>(), Scan<T>(), Scan<T>(), Scan<T>());
    [MethodImpl(256)] public (T, T, T, T, T) Quint<T>() => (Scan<T>(), Scan<T>(), Scan<T>(), Scan<T>(), Scan<T>());
    [MethodImpl(256)] public (T1, T2) Scan<T1, T2>() => (Scan<T1>(), Scan<T2>());
    [MethodImpl(256)] public (T1, T2, T3) Scan<T1, T2, T3>() => (Scan<T1>(), Scan<T2>(), Scan<T3>());
    [MethodImpl(256)] public (T1, T2, T3, T4) Scan<T1, T2, T3, T4>() => (Scan<T1>(), Scan<T2>(), Scan<T3>(), Scan<T4>());
    [MethodImpl(256)] public (T1, T2, T3, T4, T5) Scan<T1, T2, T3, T4, T5>() => (Scan<T1>(), Scan<T2>(), Scan<T3>(), Scan<T4>(), Scan<T5>());
    [MethodImpl(256)] public (T1, T2, T3, T4, T5, T6) Scan<T1, T2, T3, T4, T5, T6>() => (Scan<T1>(), Scan<T2>(), Scan<T3>(), Scan<T4>(), Scan<T5>(), Scan<T6>());
}

Measured memory_bytes: 24132