#include using namespace std; int aw,ab,bw,bb,c,d; int main(){ cin>>aw>>ab>>bw>>bb>>c>>d; int m=c-min(ab,c); cout<