#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  int dis = abs(a - b);
  int n = dis / 2, m = dis - n;
  printf("%d\n", (n * (n + 1)) / 2 + (m * (m + 1)) / 2);
  return 0;
}
