#include<bits/stdc++.h>
using namespace std;
int main(){
  int r,g;
  cin>>r>>g;
  cout<<g-r+g<<'\n';
  return 0;
}
#include<bits/stdc++.h>

using namespace std;

int main(void) {
	int first_rate, goal, second_rate;
	cin >> first_rate >> goal;
	second_rate = 2 * goal - first_rate;
	cout << second_rate << endl;
	return 0;
}
