#include <bits/stdc++.h>
using namespace std;
int main() {
  freopen("in.in", "r", stdin);
  freopen("out.out", "w", stdout);
  int a, b, suma = 0, sumb = 0;
  cin >> a >> b;
  int c = 0;
  int sum = a + b;
  if (sum % 2 == 0) {
    suma = sum / 2;
    for (int i = suma; i < 0; i--) c += i;
    c *= 2;
    cout << c;
  } else if (a - b == 1 || b - a == 1)
    cout << 1;
  else {
    suma = sum / 2;
    sumb = sum - suma;
    for (int i = suma; i > 0; i--) c += i;
    for (int i = sumb; i > 0; i--) c += i;
    cout << c;
  }
}
