L,K=map(int,input().split()) if K*2!=L: sum=(L//1)//K//2*K print(sum) else: print(0)