#include <bits/stdc++.h>
using namespace std;
int a, b;
int main() {
  cin >> a >> b;
  if (a > b) swap(a, b);
  int len = b - a;
  if (len % 2 == 0)
    cout << (len / 2) * (len / 2 + 1);
  else
    cout << (len / 2) * (len / 2 + 1) + len / 2 + 1;
}
