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