#include <bits/stdc++.h>
using namespace std;
int main() {
  int num1, num2;
  int m, sum, i;
  cin >> num1 >> num2;
  m = (num2 - num1) / 2;
  if (m < 0) m = -m;
  for (i = 0; i < m; i++) {
    sum = sum + i + 1;
  }
  sum = 2 * sum;
  if ((num2 - num1) % 2 == 1) {
    sum = sum + i + 1;
  }
  cout << sum;
  return 0;
}
