#include <bits/stdc++.h>
using namespace std;
 
int main() {
  double r, g, x;
  cin >> r >> g;
  x = 2 * g - r;
  cout << x << endl;
}
#include <bits/stdc++.h>
using namespace std;

int main() {
  int R, G;
  cin>>R>>G;
  int res = G + (G-R);
  cout<<res<<endl;
  return 0;
}