#include <bits/stdc++.h>
using namespace std;
int maxn = 1000 * 100;
int main() {
  int x, y, o = 0;
  cin >> x >> y;
  if ((max(y, x) - min(x, y)) == 1) {
    cout << 1;
    return 0;
  }
  if ((max(y, x) - min(x, y)) % 2 == 0) {
    for (int i = 1; i <= (max(y, x) - min(x, y)) / 2; i++) {
      o += i;
    }
    cout << o * 2;
  } else {
    int i = 0;
    for (i = 1; i <= (max(y, x) - min(x, y)) / 2; i++) {
      o += i;
    }
    o *= 2;
    cout << o + i + 1;
  }
}
