#include using namespace std; #define rep(i,n) for(int i=0;i<(int)(n);i++) #define ALL(v) v.begin(),v.end() typedef long long ll; template using V=vector; template using VV=V>; int main(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); ll a,b,c,d,n,p,q,r,s,t; cin>>a>>b>>c>>d>>n>>p>>q>>r>>s>>t; if(r==s){ for(int x=0;x<=a;x++){ for(int y=0;y<=b;y++){ if((t-x*p-y*q)%r!=0) continue; ll tmp=(t-x*p-y*q)/r; if(tmp<0 || tmp>c+d) continue; if(tmp>=c) cout<c) continue; ll w=n-x-y-z; if(w<0 || w>d) continue; cout<