#include <bits/stdc++.h>
using namespace std;
int main() {
  long long a, b;
  cin >> a >> b;
  long long l1 = b - (a + b) / 2;
  long long l2 = (a + b) / 2 - a;
  cout << (1 + l1) * l1 / 2 + (1 + l2) * l2 / 2;
}
