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

int main() {
    
    double r, g;
    cin >> r >> g;
    cout << (2 * g) - r << endl;
}
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
const ll MOD=1000000007;
const long double PI=3.14159265358979;
const ll MAX=0;

int main() {
  ll a,b;
  cin>>a>>b;
  cout<<b+b-a;
}
