#include <iostream>
using namespace std;
int main() {
int x, y, z, n, m, cnt = 0;
cin >> x >> y >> z >> n >> m;
for (int G = 0; G * x <= n && G <= m; G++)
for (int M = 0; M * y + G * x <= n && M + G <= m; M++) {
int xj = (n - G * x - M * y) * z;
if (G + M + xj == m)
cnt++;
}
cout << cnt << endl;
return 0;
}