l,k=map(int,input().split()) l/=2 if l==k: print(0) else: print(int(l//k*k))