L, K = [int(i) for i in input().split()] print(K * ((L - 1) // (2 * K)))