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