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