#include <bits/stdc++.h>
using namespace std;
const int maxn = 2005;
const int Mod = 1000000007;
const int INF = 0x3f3f3f3f;
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
const double PI = acos(-1);
const double ERR = 1e-10;
int main() {
  ios::sync_with_stdio(false);
  int a, b;
  int sum = 0;
  cin >> a >> b;
  int tmp = abs(a - b);
  sum += ((tmp / 2) + 1) * (tmp / 2);
  if (tmp & 1) sum += (tmp + 1) / 2;
  cout << sum << endl;
  return 0;
}
