#include #define LL long long #define MAX 2000000000 using namespace std; int countPattern(LL left, LL center) { LL right_count = 0; if(left < center) { right_count += center - left - 2; } else { right_count += MAX - center - 1; } return right_count; } int main() { LL left = 0; LL center = 0; cin >> left >> center; cout << countPattern(left, center) << endl; return 0; }