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