#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, p, q, n;
  cin >> a >> b;
  n = abs(b - a);
  if (n % 2 == 0) {
    p = ((n / 2) * (n / 2 - 1)) / 2;
    cout << 2 * p;
  } else {
    p = ((n / 2) * (n / 2 + 1)) / 2;
    q = ((n / 2 + 1) * (n / 2 + 2)) / 2;
    cout << p + q;
  }
  return 0;
}
