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