import sys



input = sys.stdin.readline





def main():

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

    A = list(map(int, input().split()))



    q, r, = divmod(N - 1, K - 1)

    ans = q + int(r > 0)



    print(ans)





if __name__ == "__main__":

    main()

import sys



input = sys.stdin.readline





def main():

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

    # A = list(map(int, input().split()))



    q, r, = divmod(N - 1, K - 1)

    ans = q + int(r > 0)



    print(ans)





if __name__ == "__main__":

    main()

import sys

input = sys.stdin.readline


def main():
    N, K = list(map(int, input().split()))
    A = list(map(int, input().split()))
    (
        q,
        r,
    ) = divmod(N - 1, K - 1)
    ans = q + int(r > 0)
    print(ans)


if __name__ == "__main__":
    main()

import sys

input = sys.stdin.readline


def main():
    N, K = list(map(int, input().split()))
    # A = list(map(int, input().split()))
    (
        q,
        r,
    ) = divmod(N - 1, K - 1)
    ans = q + int(r > 0)
    print(ans)


if __name__ == "__main__":
    main()

-    A = list(map(int, input().split())) +    # A = list(map(int, input().split()))