#include <bits/stdc++.h>
using namespace std;
bool ispalindrom(int n) {
  int q[10];
  for (int i = 0; i < 10; i++) q[i] = 0;
  int a = n;
  while (a > 0) {
    q[a % 10]++;
    a = a / 10;
  }
  for (int i = 0; i < 10; i++)
    if (q[i] % 2 != 0) return false;
  return true;
}
int toint(char a) { return (int)a - 48; }
int main() {
  long long int x, y;
  cin >> x >> y;
  long long int r = (x + y) / 2;
  long long int sum =
      abs(x - r) * (abs(x - r) + 1) / 2 + abs(y - r) * (abs(y - r) + 1) / 2;
  cout << sum;
  return 0;
}
