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