#include <bits/stdc++.h>
using namespace std;
int a, b, xi, xl, nl;
int main() {
  if (b > a) {
    xi = (b - a) / 2;
    xl = b - a - xi;
  }
  if (b < a) {
    xi = (a - b) / 2;
    xl = a - b - xi;
  }
  for (int i = 0; i <= xi; i++) {
    nl += i;
  }
  for (int j = 0; j <= xl; j++) {
    nl += j;
  }
  cout << nl << endl;
}
