#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, x, y, cnt1 = 0, cnt2 = 0;
  cin >> a >> b;
  if (a < b) {
    x = b;
    y = a;
  } else if (a > b) {
    x = a;
    y = b;
  }
  while (y != x) {
    y++;
    cnt1++;
    if (x > y) {
      x--;
      cnt2++;
    }
  }
  cout << (cnt1 * cnt2) + cnt1 << endl;
}
