#include <bits/stdc++.h>
using namespace std;
int a, b;
int main() {
  cin >> a >> b;
  int mid = a + (b - a) / 2;
  int d1 = mid - a;
  int d2 = b - mid;
  int total = (d1 + 1) * d1 / 2 + (d2 + 1) * d2 / 2;
  cout << total << endl;
}
