a,b=map(int,input().split()) if a<=b*2:print(0) else: if a%2:a=a//2 else:a=(a-1)//2 print(a//b*b)