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