n,m=map(int,input().split()) if n>m: n,m=m,n s=(m+n)*(n-m+1)/2 else: n,m=n,m s=(m+n)*(m-n+1)/2 print(int(s))