L, K = map(int, input().split()) C = 0 while L > K * 2: L -= K * 2 C += K print(C)