a,b=[int(i) for i in input().split()] c=0 for i in range(100): c=b*2*i if c>=a: print(b*(i-1)) break