#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 20;
double x, y;
int main() {
  cin >> x >> y;
  cout << ceil(abs(y - x) / 2) * (ceil(abs(y - x) / 2) + 1) / 2 +
              (floor(abs(y - x) / 2)) * (floor(abs(y - x) / 2) + 1) / 2;
}
