#include<cstdio>
#define ll long long
using namespace std;
int main(){
	ll a,b,c,d;
	scanf("%lld %lld\n%lld %lld",&a,&b,&c,&d);
	ll ans = 0;
	ans = b-c;
	printf("%lld\n",ans);
	return 0;
}
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll a,b;
	cin>>a>>b;
	cout<<(2*a+100)-b<<endl;
}
