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