#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
const long long INF = 1LL << 60;
const int MaxN = 100005;
int a, b;
int main() {
  while (scanf("%d %d", &a, &b) != EOF) {
    if (a > b) swap(a, b);
    int mid = a + ((b - a) + 1) / 2;
    int ans = 0;
    ans += (1 + mid - a) * (mid - a) / 2;
    ans += (1 + b - mid) * (b - mid) / 2;
    printf("%d\n", ans);
  }
  return 0;
}
