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