#include <bits/stdc++.h>
using namespace std;
int cnt, snt;
int a, b, c;
int main() {
  cin >> a;
  cin >> b;
  c = (a + b) / 2;
  a = abs(c - a);
  b = abs(c - b);
  cnt = ((a * a) + a) / 2;
  snt = ((b * b) + b) / 2;
  cout << cnt + snt;
}
