#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef pair pii; typedef long long ll; typedef ll int__; #define rep(i,j) for(int__ i=0;i<(int__)(j);i++) #define repeat(i,j,k) for(int__ i=(j);i<(int__)(k);i++) #define all(v) v.begin(),v.end() const int MAX_C = 2000000000; bool solve(){ int A,B; cin >> A >> B; if(A > B){ // => C > B and C != A cout << MAX_C - B -1 << endl; } else if( A < B){ // => C < B and C != A cout << B - 2 << endl; } return false; } int main() { ios::sync_with_stdio(false); while(solve()); return 0; }