a,b = map(int,input().split()) n = b - 1 if a == b : print(a // n + 1) elif a > b : print(a // n) else : print(1)