var a,b,s,i:integer;
begin
readln(a,b);
if a>b then
for i:=b to a do
s:=s+i
else
for i:=a to b do
s:=s+i;
writeln(s);
end.
var a,b,s,i:integer;
begin
readln(a,b);
if a>b then
for i:=b to a do
s:=s+i
else
for i:=a to b do
s:=s+i;
writeln(s);
end.