

function Main(input) {
  input = input.split("\n");
  var R = parseInt(input[0].split(" ")[0]);
  var G = parseInt(input[0].split(" ")[1]);
  var B = parseInt(input[0].split(" ")[2]);
  var N = parseInt(input[0].split(" ")[3]);
  var ans=0;
  for(var i=0;i*R<=N;i++){
    for(var j=0;j*G<=N;j++){
      for(var k=0;k*B<=N;k++){
        if(i*R+j*G+k*B==N){
          ans++;
        }
      }
    }
  }

  console.log('%s', ans);
  return ans;
}

function debug(n){
  var input = document.getElementById("input"+n).value;
  var ans=Main(input);
  var result="WA";
  if(ans==document.getElementById("output"+n).value.split("\n")[0]){
    result="AC";
  }
  document.getElementById("result"+n).innerHTML=result;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));