L, K = map(int, input().split(' ')) if L == 2 * K: print(0) else: M = L // 2 // K J = M * K print(J)