fun main(args: Array<String>) {
    val (a, b) = readInputLine().split(" ").map { Integer.parseInt(it) }

    var bef = 1

    for (i in 2..999) {
        val aft = i * (i + 1) / 2
        if (aft - b == bef - a) {
            println("${aft - b}")
            return
        }
        bef = aft
    }
}
 
fun readInputLine(): String {
    return readLine()!!
}
