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