#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c,d,e,f=0; cin>>a>>b>>c>>d>>e; for(int i=1;i<=d/a+1;i++){ for(int j=1;j<=d/b+1;j++){ for(int k=1;k<=d/c+1;k++){ if(i+k+j==d&&i*a+j*b+k/c==e&&k%c==0){ f++; } } } } cout<<f; }