a, b = map(int, input().split()) k = 0 while a > 2 * b: a -= 2 * b k += b print(k)