def solve():

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

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

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

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

    else:

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



if __name__ == '__main__':

    print((solve()))
def solve():

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

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

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

    else:

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



if __name__ == '__main__':

    print((solve()))
def solve():
    n, k = list(map(int, input().split()))
    A = list(map(int, input().split()))
    if (n - 1) % (k - 1) != 0:
        return (n - 1) // (k - 1) + 1
    else:
        return (n - 1) // (k - 1)


if __name__ == "__main__":
    print((solve()))

def solve():
    n, k = list(map(int, input().split()))
    if (n - 1) % (k - 1) != 0:
        return (n - 1) // (k - 1) + 1
    else:
        return (n - 1) // (k - 1)


if __name__ == "__main__":
    print((solve()))

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