"use strict";
function Main(input) {
  const args = input.split(' ').map(m => parseInt(m));
  const R = args.shift();
  const G = args.shift();
  const B = args.shift();
  const N = args.shift();
  let count = 0;

  const countR = Math.trunc(N / R);
  const modR = N % R;
  for (let i = 0; i <= countR; i++) {
    const need = modR + (R * i);
    if (need === 0) {
      // console.log(`R: ${countR - i}`);
      count++;
      continue;
    }
    const countG = Math.trunc(need / G);
    const modG = need % G;
    for (let j = 0; j <= countG; j++) {
      const need2 = modG + (G * j);
      if (need2 === 0) {
        // console.log(`R: ${i}, G: ${j}`);
        count ++;
      } else if ((need2 % B) === 0) {
        // console.log(`R: ${countR - i}, G: ${countG - j}, B: ${need2 / B}`);
        count ++;
      }
    }
  }

  console.log(count);


}

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