#include <bits/stdc++.h>
using namespace std;
int main() {
  int p1, p2, sum;
  cin >> p1 >> p2;
  int i, j, k, p;
  p = abs(p1 - p2);
  if (p == 1) {
    cout << 1;
  } else if (p % 2 == 0) {
    p = p / 2;
    sum = 0;
    for (i = 1; i <= p; i++) {
      sum += p;
    }
    cout << 2 * p;
  } else {
    p = p - 1;
    p = p / 2;
    sum = 0;
    for (i = 1; i <= p; i++) {
      sum += p;
    }
    sum += 2 * p + i;
    cout << sum;
  }
}
