#include <bits/stdc++.h>
using namespace std;
vector<long long> adj[101];
void make_edge(long long a, long long b) {
  adj[a].push_back(b);
  adj[b].push_back(a);
}
long long sum_of(long long n) {
  if (n == 0) return 0;
  return (n * (n + 1)) / 2;
}
int main() {
  long long a, b, diff, ans = 0;
  cin >> a >> b;
  if (abs(a - b) == 1)
    cout << "1";
  else {
    diff = abs(a - b);
    if (diff % 2) ans += (diff / 2) + 1;
    ans += (2 * sum_of(diff / 2));
    cout << ans;
  }
  return 0;
}
