#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, i;
  cin >> a >> b;
  int ans = 1001;
  for (i = 1; i <= 1000; i++) {
    ans = min(ans, max(abs(a - i), abs(b - i)));
  }
  cout << ans;
}
