/*Name:chirag darji (Mr_Mickey) */
 
#include<bits/stdc++.h>
 
typedef long long ll;
typedef long double ld;
 
#define LOCAL 0
#define F first
#define S second
#define pb push_back
#define pob pop_back
#define mp make_pair
#define si(n) scanf("%d",&n)
#define sll(n) scanf("%lld",&n)
#define ss(n) scanf("%s",n)
#define what_is(x) cerr << #x << " is " << x << endl;
#define all(v) (v).begin(),(v).end()
#define tr(c,i) for(typeof((c).begin() i = (c).begin(); i != (c).end(); i++) //iterator..
#define present(c,x) ((c).find(x) != (c).end()) 
#define cpresent(c,x) (find(all(c),x) != (c).end()) //for vector..
#define fastIO 	std::ios::sync_with_stdio(false);cin.tie(NULL)
 
const long double EPS = 1e-10;
const int MOD = 1000000007ll;
const int mod1 = 1000000009ll;
const int mod2 = 1100000009ll;
int INF = (int)1e9;
ll INFINF = (ll)1e18;
int debug = 0;
long double PI = acos(-1.0);
 
using namespace std;
 
ll gcd(ll a,ll b){ll ans=__gcd(a,b);return ans;}
int str_to_int(string s){int ans=atoi(s.c_str());return ans;}
string int_to_str(int i){string ans=to_string(i);return ans;}
bool cmp(string a,string b){ if(a.size()!=b.size())return a.size()<b.size();return a<b;}

int add(int a,int b,int m=MOD){int x=a+b;while(x>=m)x-=m;while(x<0)x+=m;return x;}
int sub(int a,int b,int m=MOD){int x=a-b;while(x<0)x+=m;while(x>=m)x-=m;return x;}
int mul(int a,int b,int m=MOD){ll x=a*1ll*b;x%=m;while(x<0)x+=m;return (int)x;}


int main(){
	std::ios::sync_with_stdio(false);cin.tie(NULL);
	int a,b;
	cin >> a >> b;
	int ans=0;
	int diff=abs(a-b);
	if(diff==1){
		ans=1;
	}
	else if(diff==2){
		ans=2;
	}
	else{
		int x=diff/2;
		ans=ans+x*(x+1);
		ans=ans+(x+1);
	}
	cout << ans << "\n";
	return 0;
}