# import sys

# input = sys.stdin.readline

import collections

import itertools



def main():

    n, k = input_list()

    a = input_list()

    if (n - 1) % (k - 1) == 0:

        print(((n-1) // (k-1)))

    else:

        v = (n-1) // (k-1)

        print((v + 1))





def input_list():

    return list(map(int, input().split()))





def input_list_str():

    return list(map(str, input().split()))





if __name__ == "__main__":

    main()

# import sys

# input = sys.stdin.readline

import collections

import itertools



def main():

    n, k = input_list()

    a = input_list()

    b = n - 1

    x = k - 1

    ans = b // x

    if b % x == 0:

        print(ans)

    else:

        print((ans + 1))



def input_list():

    return list(map(int, input().split()))





def input_list_str():

    return list(map(str, input().split()))





if __name__ == "__main__":

    main()

# import sys
# input = sys.stdin.readline
import collections
import itertools


def main():
    n, k = input_list()
    a = input_list()
    if (n - 1) % (k - 1) == 0:
        print(((n - 1) // (k - 1)))
    else:
        v = (n - 1) // (k - 1)
        print((v + 1))


def input_list():
    return list(map(int, input().split()))


def input_list_str():
    return list(map(str, input().split()))


if __name__ == "__main__":
    main()

# import sys
# input = sys.stdin.readline
import collections
import itertools


def main():
    n, k = input_list()
    a = input_list()
    b = n - 1
    x = k - 1
    ans = b // x
    if b % x == 0:
        print(ans)
    else:
        print((ans + 1))


def input_list():
    return list(map(int, input().split()))


def input_list_str():
    return list(map(str, input().split()))


if __name__ == "__main__":
    main()

-    if (n - 1) % (k - 1) == 0: -        print(((n - 1) // (k - 1))) +    b = n - 1 +    x = k - 1 +    ans = b // x +    if b % x == 0: +        print(ans) -        v = (n - 1) // (k - 1) -        print((v + 1)) +        print((ans + 1))