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