#include <bits/stdc++.h>
using namespace std;
int main() {
  int z, b, n, t, a;
  cin >> z >> b;
  n = abs(z - b);
  a = (n > 1) ? n / 2 : n;
  if (n % 2 == 0) {
    t = a * (a + 1);
  } else {
    t = a * (a + 1) + a + 1;
  }
  cout << t;
}
