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