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