#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define Would #define you int main() { long long a, b, ans; cin >> a >> b; if (a > b) { ans = b - 2; } else { ans = 2000000000 - b + 1; } cout << ans << endl; }