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