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