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