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

int main(){
  int r,g;
  double p;
  cin >> r >> g;
  //g = (r + p) / 2
  p = 2 * g - r;
  cout << p << endl;
}
  