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