import std.stdio, std.algorithm, std.string, std.conv, std.array, std.range, std.math;
int read() { return readln.chomp.to!int; }
int[] reads() { return readln.split.to!(int[]); }

void solve() {
    int n, k; readf("%d %d\n", &n,&k);
    int[] a = reads();

    int pk = a.countUntil(1).to!int;
    writeln(ceil(1. * pk / (k-1)) + ceil(1. * ((n-1) - pk) / (k-1)));
}

void main() {
    solve();
    readln;
}