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