#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
int d,e,f;
cin>>d>>e>>f;
cout<<((a+b+c)*3-(d+e+f)*2)/((a-d)+(b-e)+(c-f));
return 0;
}
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c;
cin>>a>>b>>c;
int d,e,f;
cin>>d>>e>>f;
cout<<((a+b+c)*3-(d+e+f)*2)/((a-d)+(b-e)+(c-f));
}