#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  int b;
  scanf("%d", &a);
  scanf("%d", &b);
  if (a > b) {
    a = a + b;
    b = a - b;
    a = a - b;
  }
  int dis;
  int j;
  int total;
  dis = b - a;
  j = abs(dis / 2);
  if (dis % 2 != 0 && dis != 1)
    total = (1 + j) * j + j + 1;
  else
    total = (1 + j) * j;
  printf("%d", total);
}
