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