#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 <bits/stdc++.h>
using namespace std;

int main() {
  // ここにプログラムを追記
  int rating, next_rating, performance;
  cin >> rating >> next_rating;
  
  performance = 2 * next_rating - rating;
  cout << performance << endl;
}