#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
	int r, g;
	cin >> r;
	cin >> g;
	cout << g - r + g << endl;
}
#include <iostream>
#include<set>
#include<vector>
#include<string>
#include<iterator>
#include<iomanip>
#include<cmath>
#include<map>
#include<string.h>
#include<algorithm>

using namespace std;
void ll(){
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(0);
}

int main() {

	ll();
	
	int x, y,ave=0;
	cin >> x >> y;
	ave = (2 * y) - x;
	cout << ave << endl;

}