l, k = map(int, input().split()) if l > k*2: kai = l//(k*2) else: print("0") exit() print(k*kai)