x, y = map(int,input().split()) if x % (y * 2) == 0 : print( (x // 2) - y ) else : print( (x // (y * 2)) * y )