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