#include<bits/stdc++.h>
using namespace std;
int main(){
  int r,g;
  cin>>r>>g;
  cout<<g-r+g<<'\n';
  return 0;
}
    #include <bits/stdc++.h>
    using namespace std;
     
    int main() {
      double late = 0.0 , wanna = 0.0;
      cin >> late >> wanna;
      cout << wanna * 2 - late;
    }