#include <bits/stdc++.h>
using namespace std;
int main() {
  double a, b, diff, mid, n, ans;
  cin >> a >> b;
  diff = abs(a - b);
  if (fmod(diff, 2.0) == 0.0) {
    mid = (diff / 2);
    n = ceil(mid);
    ans = n * (n + 1);
    cout << ans;
  } else {
    mid = (diff / 2);
    n = ceil(mid);
    ans = n * n;
    cout << ans;
  }
  return 0;
}
