#include <bits/stdc++.h>
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  int len = a - b;
  if (len < 0) len = -len;
  int ma = len >> 1, mb = len - ma;
  printf("%d\n", (ma * (ma + 1) >> 1) + (mb * (mb + 1) >> 1));
}
