#include <bits/stdc++.h>
int main() {
  int len, a, b, n, cntA, cntB, sum, x, y;
  scanf("%d%d", &a, &b);
  len = abs(a - b);
  cntA = len / 2;
  cntB = len - len / 2;
  x = (cntA * (cntA + 1)) / 2;
  y = (cntB * (cntB + 1)) / 2;
  sum = x + y;
  printf("%d", sum);
}
