L, K = map(int, input().split()) if L%K*2 == 0: i = (L//(K*2))-1 else: i = L//(K*2) print(i)