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