l,k = map(int,input().split()) ans = 0 while l >= 0: if l - (k * 2) > 0: ans += k l -= (k * 2) else: break print(ans)