import sys



n, k, *a = list(map(int, sys.stdin.read().split()))



def main():

    return ((n - 1) + (k - 1) - 1) // (k - 1)



if __name__ == '__main__':

    ans = main()

    print(ans)
import sys



n, k = list(map(int, sys.stdin.readline().split()))



def main():

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



if __name__ ==  '__main__':

    main()
import sys

n, k, *a = list(map(int, sys.stdin.read().split()))


def main():
    return ((n - 1) + (k - 1) - 1) // (k - 1)


if __name__ == "__main__":
    ans = main()
    print(ans)

import sys

n, k = list(map(int, sys.stdin.readline().split()))


def main():
    print(((n + k - 3) // (k - 1)))


if __name__ == "__main__":
    main()

-n, k, *a = list(map(int, sys.stdin.read().split())) +n, k = list(map(int, sys.stdin.readline().split())) -    return ((n - 1) + (k - 1) - 1) // (k - 1) +    print(((n + k - 3) // (k - 1))) -    ans = main() -    print(ans) +    main()