def main():

    n, k, *a = list(map(int, open(0).read().split()))

    ans = 1 + (n - k) // (k - 1) + ((n - k) % (k - 1) != 0)

    print(ans)





if __name__ == '__main__':

    main()

def main():

    n, k = list(map(int, input().split()))

    ans = 1 + (n - k) // (k - 1) + ((n - k) % (k - 1) != 0)

    print(ans)





if __name__ == '__main__':

    main()

def main():
    n, k, *a = list(map(int, open(0).read().split()))
    ans = 1 + (n - k) // (k - 1) + ((n - k) % (k - 1) != 0)
    print(ans)


if __name__ == "__main__":
    main()

def main():
    n, k = list(map(int, input().split()))
    ans = 1 + (n - k) // (k - 1) + ((n - k) % (k - 1) != 0)
    print(ans)


if __name__ == "__main__":
    main()

-    n, k, *a = list(map(int, open(0).read().split())) +    n, k = list(map(int, input().split()))