#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y, sum, n, z;
  cin >> x >> y;
  if (x > y)
    z = x - y;
  else
    z = y - x;
  n = z / 2;
  if (z % 2 == 1) {
    sum = (n / 2) * (2 + (n - 1)) + (n + 1) * (2 + n) / 2;
  } else
    sum = (n) * (2 + (n - 1));
  cout << sum << endl;
  return 0;
}
