#include <bits/stdc++.h>
int main() {
  int a, b;
  std::cin >> a >> b;
  const auto distance = std::abs(a - b);
  const auto half = distance / 2;
  int result = half * (half + 1) / 2;
  if (2 * half != distance) {
    result += (half + 1);
  }
  std::cout << result;
}
