#include <bits/stdc++.h>
#define rep(i, N) for(int i = 0; i < (int)N; i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> vi;
const int INF = (1 << 30); // > 10^9, int 2*INF


int main() {
    int a, b, ans = 0, flag = 0;
    cin >> a >> b;
    //vi a(n); rep(i, n) scanf("%d", &a[i]);
    

    //puts( (flag ? "Yes" : "No") );
    //printf("%.12lf\n", ans);
    //rep(i, n) printf("%d\n", a[i]);
    cout << (a*2+100)-b; printf("\n");
}

#include<bits/stdc++.h>

using namespace std;

#define FastIO ios_base :: sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define read(in) freopen("Input.txt","r",stdin)
#define write(out) freopen("Ouput.txt","w",stdout)
#define pf printf
#define sf scanf
#define fr0(i,n) for(int i=0 ; i<n ; i++)
#define fr1(i,n) for(int i=1 ; i<=n ; i++)
#define fr2(i,n) for(int i=n ; i>=1 ; i--)
#define frx(i,x,n) for(int i=x ; i<=n ; i++)
#define sf1(val) scanf("%lld",&val)
#define sf2(val1,val2) scanf("%lld %lld",&val1,&val2)
#define INF 999999999999999999
#define Pi 2*acos(0.0)
#define len 200000

typedef long long int lli;

lli a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,sum=0,total=0,res=0,ans=0;

int main()
{
    //FastIO;

    //read(in);

    sf2(a,b);

    sum=2*a+100;

    pf("%lld\n",abs(sum-b));
}