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