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