L, K = map(int, input().split()) m = L // K if m > 2: print(int(m // 2 * K)) else: print(0)