x = list(map(int,input().split())) x.sort() a = x[0] b = x[1] print(round((a+b)*(b-a+1)/2))