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