l, k = list(map(int, input().split())) if 2*k == l: print("0") else: answer = int(l / (2*k)) * k print("{}".format(answer))