#include <bits/stdc++.h>
using namespace std;
int main()
{
    int a,b;
    while(scanf("%d%d",&a,&b)==2) cout<<b*2-a<<endl;
    return 0;
}