l,k = map(int, input().split()) count = 0 while l > (k*2) : l = l - (k*2) count += 1 print (count * k)