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

int main() {
  int r;
  int g;
  int x;
  
  cin >> r;
  cin >> g;

  x = 2*g - r;
  
  cout << x << endl;
}

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int R, G;
  cin >> R >> G;
  cout << G - R + G << endl;
}