'use strict'
function Main(input){
  input=input.trim().split(/\s+/).map(x=>x-0);
  var R=input[0],G=input[1],B=input[2],N=input[3];
  function rg(M){
    var counter=0;
    var r=Math.floor(M/R);
    var g=0;
    while(r>=0){
      while(r*R+g*G<M)g++;
      if(r*R+g*G===M)counter++;
      r--;
    }
    return counter;
  }
  var b=0;
  var ans=0;
  while(b*B<=N){
    ans+=rg(N-b*B);
  }
  console.log(ans);
}

Main(require('fs').readFileSync('/dev/stdin','utf8'));
