#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  int c = b - a;
  int j = c / 2;
  int k = c - j;
  int s1 = (j * (j + 1)) / 2;
  int s2 = (k * (k + 1)) / 2;
  cout << s1 + s2 << endl;
  return 0;
}
