#include <bits/stdc++.h>
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  int diff = a - b;
  int total = 0;
  int i;
  for (i = 1; i <= diff / 2; i++) total += i;
  total += i * (diff % 2);
  printf("%d", total);
  return 0;
}
