#include <bits/stdc++.h>
using namespace std;
int main()
{
int x, y, z, n, m, cnt = 0;
cin >> x >> y >> z >> n >> m;
for(int i = 0; i * x <= n && i <= m; i++)
{
for(int j = 0; j * y + i * x <= n && i + j <= m; j++)
{
int k = (n - i * x - j * y) * z;
if(i + j + k == n) cnt++;
}
}
cout << cnt;
return 0;
}