#include using namespace std; main(){ int a1,a2,b1,b2,c,d;cin>>a1>>a2>>b1>>b2>>c>>d; b1+=c-a2<0?0:c-a2;a1-=c-a2<0?0:c-a2; cout<