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