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