#include<bits/stdc++.h> using namespace std; int main(){ int s,r1; cin>>r1>>s; for(int i=0;i<=999999;i++){ if((i+r1)/2==s){ cout<<i; break; } } }