#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  int a, b, n;
  cin >> a >> b;
  if (abs(a - b) == 1)
    cout << "1";
  else if ((a - b) % 2 == 0) {
    n = abs(a - b) / 2;
    cout << n * (n + 1);
  } else {
    n = abs(a - b) / 2;
    cout << (n + 1) * (n + 1);
  }
  return 0;
}
