#include <bits/stdc++.h>
using namespace std;
long long x, k, a, b;
int main() {
  long long ans = 0;
  cin >> a >> b;
  if (a < b) swap(a, b);
  x = (a - b) / 2;
  k = (a - b + 1) / 2;
  cout << x * (x + 1) / 2 + k * (k + 1) / 2 << endl;
  return 0;
}
