def main():

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

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



    ans = (n-2) // (k-1) + 1

    print(ans)





if __name__ == "__main__":

    main()

import math





def main():

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

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

    ans = math.ceil((n-1)/(k-1))

    print(ans)





if __name__ == "__main__":

    main()

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


if __name__ == "__main__":
    main()

import math


def main():
    n, k = list(map(int, input().split()))
    As = list(map(int, input().split()))
    ans = math.ceil((n - 1) / (k - 1))
    print(ans)


if __name__ == "__main__":
    main()

+import math + + -    ans = (n - 2) // (k - 1) + 1 +    ans = math.ceil((n - 1) / (k - 1))