#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, f[1005], z = 1, d = 0, cnt = 0;
  cin >> a >> b;
  f[1] = 1;
  f[2] = 2;
  for (int i = 3; i <= 1000; i++) {
    if (cnt == 0) {
      cnt = 2;
      z++;
    }
    if (cnt) {
      f[i] = f[i - 1] + z;
      cnt--;
    }
  }
  d = abs(b - a);
  cout << f[d] << endl;
}
