input = open(0).read



N, K, *An = list(map(int, input().split()))





def main():

    num = (N - 1) / (K - 1)

    print((int(num) + 1 if num != int(num) else int(num)))

    return





main()

import math



N, K = list(map(int, input().split()))





def main():

    print((math.ceil((N - 1) / (K - 1))))

    return





main()

input = open(0).read
N, K, *An = list(map(int, input().split()))


def main():
    num = (N - 1) / (K - 1)
    print((int(num) + 1 if num != int(num) else int(num)))
    return


main()

import math

N, K = list(map(int, input().split()))


def main():
    print((math.ceil((N - 1) / (K - 1))))
    return


main()

-input = open(0).read -N, K, *An = list(map(int, input().split())) +import math + +N, K = list(map(int, input().split())) -    num = (N - 1) / (K - 1) -    print((int(num) + 1 if num != int(num) else int(num))) +    print((math.ceil((N - 1) / (K - 1))))