#include <bits/stdc++.h>
using namespace std;
int main() {
  float a, b, c, t;
  cin >> a >> b;
  if (a > b) swap(a, b);
  c = (b - a) / 2;
  t = floor(c);
  c = ceil(c);
  int f = 0, y = 0;
  for (int i = 1; i <= c; i++) {
    f += i;
  }
  for (int i = 1; i <= t; i++) {
    y += i;
  }
  cout << f + y;
  return 0;
}
