#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, tire = 1, flag, T, tire2;
  cin >> a >> b;
  int f = fabs(a - b);
  if (f == 1)
    cout << 1 << endl;
  else if (f == 2)
    cout << 1 << endl;
  else {
    flag = f / 2;
    T = f % 2;
    for (int i = 1; i <= flag; i++) tire = tire + 1;
    tire2 = 2 * tire;
    for (int i = flag + 1; i <= flag + 1; i++) tire2 += i;
    cout << tire2 << endl;
  }
  return 0;
}
