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