#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 7;
const int N = 1e6 + 10;
int main() {
  int n;
  int a, b;
  cin >> a >> b;
  n = abs(a - b);
  int x = n / 2;
  int y = n - x;
  cout << x * (x + 1) / 2 + y * (y + 1) / 2 << endl;
  return 0;
}
