#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ui = unsigned int;
const int NMax = 3e6 + 5;
const ll inf_ll = 1e18 + 5;
const int inf_int = 1e9 + 5;
const int mod = 100003;
using zint = int;
int N;
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  int a, b;
  cin >> a >> b;
  int dif = abs(b - a);
  int moves1 = dif / 2;
  int moves2 = (dif % 2 == 1) ? dif / 2 + 1 : dif / 2;
  int sum = moves1 * (moves1 + 1) / 2;
  sum += moves2 * (moves2 + 1) / 2;
  cout << sum << '\n';
  return 0;
}
