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