#include <bits/stdc++.h>
using namespace std;
const int E = 1e5 + 5;
int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, x, y, z;
string s, t, u, v, w;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> a >> b;
  cout << abs(a - (a + b) / 2) * (abs(a - (a + b) / 2) + 1) / 2 +
              abs(b - (a + b) / 2) * (abs(b - (a + b) / 2) + 1) / 2;
}
