#include <bits/stdc++.h>

using namespace std;

int main() {
    int s, r1;
    cin >> r1 >> s;
    cout << s * 2 - r1 << endl;
    return 0;
}