#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  cin >> a >> b;
  if ((abs(a - b)) % 2 != 0) {
    int k, q = 0;
    k = (abs(a - b) - 1) / 2;
    int i, j = 0, temp = 0;
    for (i = 1; i <= k; i++) {
      j = j + 1;
      q = j + temp;
      temp = j;
    }
    cout << q * 2 + (j + 1);
  }
  if ((abs(a - b)) % 2 == 0) {
    int m;
    m = (abs(a - b)) / 2;
    int n, p = 0, o = 0;
    int tem = 0;
    for (n = 1; n <= m; n++) {
      o = o + 1;
      p = o + tem;
      tem = o;
    }
    cout << p * 2;
  }
  return 0;
}
