#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, val, x, y, z, part1, part2;
  cin >> a >> b;
  if (a < b) {
    swap(a, b);
  }
  val = a - b;
  x = (val * (val + 1)) / 2;
  part1 = val / 2;
  part2 = val - part1;
  y = (part1 * (part1 + 1) / 2) + (part2 * (part2 + 1) / 2);
  cout << min(x, y) << endl;
  return 0;
}
