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