#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y;
  cin >> x >> y;
  int d = abs(x - y);
  int n = d / 2;
  if (d % 2 == 0)
    cout << (n + 1) * n << endl;
  else {
    cout << ((n + 1) * n) + n + 1 << endl;
  }
}
