
import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.string;

void main()
{
	auto ab = readln.split.to!( int[] );
	writeln( solve( ab[ 0 ], ab[ 1 ] ) );
}

auto solve( in int a, in int b )
{
	auto d = b - a;
	auto h = iota( 1, d ).sum;
	
	return h - a;
}

unittest
{
	assert( solve( 8, 13 ) == 2 );
	assert( solve( 54, 65 ) == 1 );
}
