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