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