if __name__ == "__main__": L, K = map(int, input().split()) answer = ((L/2 - 1) // K) * K# your code goes here print(answer)