def main(): l, k = [int(x) for x in input().split(" ")] bites = k * 2 quotient = l // bites if l <= bites: ans = 0 else: ans = quotient * k print(ans) if __name__ == "__main__": main()