#include <iostream>
#include <vector>
using namespace std;

int main()
{
    int r, g, b, n;
    cin >> r;
    cin >> g; 
    cin >> b;
    cin >> n;
    
    int rn, gn, bn;
    int count = 0;
    for(int i = 0; i * r <= n; i++){
        for(int j = 0; j * g <= (n-r*i); j++){
            if ((n-r*i-g*j) % b == 0){
                count ++;
            }
        }
    }
    
    cout << count;
}
