#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int a, b, i;
  cin >> a >> b;
  if ((abs(a - b) + 1) % 2 == 0) {
    long long int temp = (abs(a - b) + 1) / 2;
    long long int temp1 = temp - 1;
    long long int temp2 = (temp * (temp + 1)) / 2;
    long long int temp3 = (temp1 * (temp1 + 1)) / 2;
    cout << temp3 + temp2 << endl;
  } else {
    long long int temp = (abs(a - b) + 1) / 2;
    cout << temp * (temp + 1) << endl;
  }
  return 0;
}
