const t={input:require('fs').readFileSync('/dev/stdin','utf8').split(/[\s]/),n:(arg:number=0):any=>{if(arg){const a:number[]=[];for(let i=0;i<arg;i++) {a.push(t.n());}return a;}else{const a = t.input[0];t.input.shift();return Number(a);}},s:(arg:number=0):any=>{if(arg){const a:string[]=[];for(let i=0;i<arg;i++){a.push(t.s());}return a;}else{const a=t.input[0];t.input.shift();return String(a);}},c:(arg:number=0):any=>{if(arg) {const a:string[]=[];for(let i=0;i<arg;i++) {a.push(t.c());}return a;}else{let a=t.input[0].split('');const b=a[0];a.shift();if(a.length>0){t.input[0]=a.join('');}else{t.input.shift();}return String(b);}},o: (...arg)=>{console.log(...arg);},abs:(a)=>{return Math.abs(a);},min:(...a)=>{return Math.min(...a);},max:(...a)=>{return Math.max(...a);},floor:(a)=>{return Math.floor(a);},asc:(ar:number[])=>{return ar.sort((a,b)=>{return a-b});},desc:(ar:number[])=>{ return ar.sort((a,b)=>{return b-a});},sw:(a,arr:any[],op:'=='|'>='|'>'|'<='|'<'='==')=>{for(let i=0;i<arr.length;i+=2){if(eval(a+op+arr[i]))return arr[i+1]}return arr[arr.length-1];}}
const main = ()=>{
  let [a,b,c] = t.n(3)
  t.o(a==b?c:a==c?b:a)
}
main()


"use strict";

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

function main(input) {
  const [a, b, c] = input.trim().split(" ").map(Number);

  const ans = a === b ? c : a === c ? b : a;
  console.log(ans);
}


const main = (input) => {
  input = input.split(' ');
  const A = parseInt(input[0], 10);
  const B = parseInt(input[1], 10);
  const C = parseInt(input[2], 10);

  if (A==B&&A!==C){
    console.log(C);
  }else if(A==C||A!=B) {
    console.log(B);
  }else{
    console.log(A);
  }

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


const main = (input) => {
  input = input.split(' ');
  const A = parseInt(input[0], 10);
  const B = parseInt(input[1], 10);
  const C = parseInt(input[2], 10);

  if (A==B!==C){
    console.log(C);
  }else if(A==C!== B) {
    console.log(B);
  }else{
    console.log(A);
  }

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


r0,g0,b0,n=map(int,input().split())
ans=0
l=[r0,g0,b0]
l.sort(reverse=True)
r=l[0]
g=l[1]
b=l[2]
x=0
while x*r<=n:
    y=0
    if g==1:
        ans+=1+n-x*r
        x+=1
        continue
    if b==1:
        ans+=1+(n-x*r)//g
        x+=1
        continue
    while y*g<=n-x*r:
        if (n-x*r-y*g) % b == 0:
            ans+=1
        y+=1
    x+=1
print(ans)


r,g,b,n = map(int,input().split())
a = [0]*(n+1)
a[0] = 1
for j in range(n+1-r):
    a[j+r]=a[j]
for j in range(n+1-b):
    a[j+b]+=a[j]
for j in range(n+1-g):
    a[j+g]+=a[j]
    #print(a)
print(a[n])


r, g, b, n = map(int, input().split())

dp = [0 for i in range(n+1)]
dp[0] = 1

for i in range(r, n+1, r):
    dp[i] = 1

for i in range(g, n+1):
    dp[i] += dp[i-g]

for i in range(b, n+1):
    dp[i] += dp[i-b]

print(dp[n])


R, G, B, n = map(int, input().split())
cnt = 0
for r in range(n+1):
    for g in range(n+1):
        bb = n - r*R - g*G
        if bb >= 0 and bb%B == 0:
            cnt += 1
print(cnt)


r,g,b,n=map(int,input().split())
cnt=0
for i in range(n+1):
    for j in range(n+1):
        if (n-i*r-j*g) %b ==0 and 0<=(n-i*r-j*g) // b <= 3000:
            # print(i,j,(n-i*r-j*g)//3)
            cnt+=1
print(cnt)


r,g,b,n=map(int,input().split())
cnt=0
for i in range(int(n//r)+1):
    for j in range(int(n//g)+1):
        if (n-i*r-j*g) %b ==0 and 0<=(n-i*r-j*g) // b <= 3000:
            # print(i,j,(n-i*r-j*g)//3)
            cnt+=1
print(cnt)


import java.io.*;
import java.util.*;

class Main {
    static int x, y, z;
    public static void main(String[] args) throws IOException {
        Scan sc = new Scan();
        int a = sc.scanInt();
        int b = sc.scanInt();
        int c = sc.scanInt();
        int d = sc.scanInt();
        int res = 0;
        for(int i = 0; i*a <= d; ++i){
            int rightSide = d - (a*i);
            if(rightSide == 0)
                ++res;
            else {
                int tr = solve(b, c, rightSide);
                res += tr;
            }
        }
        System.out.println(res);

    }
    static void egcd(int a, int b){
        if(b == 0){
            x = 1;
            y = 0;
            z = a;
            return;
        }

        egcd(b, a%b);
        int t = y;
        y = x - (a/b)*y;
        x = t;
    }

    static int solve(int b, int c, int r){
        if(r < Math.min(b, c))
            return 0;
        egcd(b, c);
        if(x < y){
            int t = c;
            c = b;
            b = t;
            t = x;
            x = y;
            y = t;
        }
        if(r%z != 0)
            return 0;
        x *= r;
        y *= -r;
        int k1 = x/c;
        int k2 = (y+b-1)/b;
        if(k1 < k2)
            return 0;
            int res = k1-k2+1;
        return (k1-k2+1);
    }
}

class Scan {
    private byte[] buf=new byte[1024];
    private int index;
    private InputStream in;
    private int total;
    public Scan()
    {
        in=System.in;
    }
    public int scan()throws IOException
    {
        if(total<0)
        throw new InputMismatchException();
        if(index>=total)
        {
            index=0;
            total=in.read(buf);
            if(total<=0)
            return -1;
        }
        return buf[index++];
    }
    public int scanInt()throws IOException
    {
        int integer=0;
        int n=scan();
        while(isWhiteSpace(n))
        n=scan();
        int neg=1;
        if(n=='-')
        {
            neg=-1;
            n=scan();
        }
        while(!isWhiteSpace(n))
        {
            if(n>='0'&&n<='9')
            {
                integer*=10;
                integer+=n-'0';
                n=scan();
            }
            else throw new InputMismatchException();
        }
        return neg*integer;
    }
    public long scanLong()throws IOException
    {
        long integer=0;
        int n=scan();
        while(isWhiteSpace(n))
        n=scan();
        int neg=1;
        if(n=='-')
        {
            neg=-1;
            n=scan();
        }
        while(!isWhiteSpace(n))
        {
            if(n>='0'&&n<='9')
            {
                integer*=10;
                integer+=n-'0';
                n=scan();
            }
            else throw new InputMismatchException();
        }
        return neg*integer;
    }
    public double scanDouble()throws IOException
    {
        double doub=0;
        int n=scan();
        while(isWhiteSpace(n))
        n=scan();
        int neg=1;
        if(n=='-')
        {
            neg=-1;
            n=scan();
        }
        while(!isWhiteSpace(n)&&n!='.')
        {
            if(n>='0'&&n<='9')
            {
                doub*=10;
                doub+=n-'0';
                n=scan();
            }
            else throw new InputMismatchException();
        }
        if(n=='.')
        {
            n=scan();
            double temp=1;
            while(!isWhiteSpace(n))
            {
                if(n>='0'&&n<='9')
                {
                    temp/=10;
                    doub+=(n-'0')*temp;
                    n=scan();
                }
                else throw new InputMismatchException();
            }
        }
        return doub*neg;
    }
    public String scanString()throws IOException
    {
        StringBuilder sb=new StringBuilder();
        int n=scan();
        while(isWhiteSpace(n))
        n=scan();
        while(!isWhiteSpace(n))
        {
            sb.append((char)n);
            n=scan();
        }
        return sb.toString();
    }

    public char scanCharacter() throws IOException {
        int n=scan();
        while(isWhiteSpace(n))
        n=scan();
        return (char)n;
    }
    private boolean isWhiteSpace(int n)
    {
        if(n==' '||n=='\n'||n=='\r'||n=='\t'||n==-1)
        return true;
        return false;
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.Reader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        MyInput in = new MyInput(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BRGBBoxes solver = new BRGBBoxes();
        solver.solve(1, in, out);
        out.close();
    }

    static class BRGBBoxes {
        public void solve(int testNumber, MyInput in, PrintWriter out) {
            long[][] dp = new long[4][3001];
            dp[0][0] = 1;
            int r = in.nextInt();
            int g = in.nextInt();
            int b = in.nextInt();
            int n = in.nextInt();
            for (int i = 0; i <= n; i++) {
                dp[1][i] = dp[0][i] + (i >= r ? dp[1][i - r] : 0);
            }
            for (int i = 0; i <= n; i++) {
                dp[2][i] = dp[1][i] + (i >= g ? dp[2][i - g] : 0);
            }
            for (int i = 0; i <= n; i++) {
                dp[3][i] = dp[2][i] + (i >= b ? dp[3][i - b] : 0);
            }
            out.println(dp[3][n]);
        }

    }

    static class MyInput {
        private final BufferedReader in;
        private static int pos;
        private static int readLen;
        private static final char[] buffer = new char[1024 * 8];
        private static char[] str = new char[500 * 8 * 2];
        private static boolean[] isDigit = new boolean[256];
        private static boolean[] isSpace = new boolean[256];
        private static boolean[] isLineSep = new boolean[256];

        static {
            for (int i = 0; i < 10; i++) {
                isDigit['0' + i] = true;
            }
            isDigit['-'] = true;
            isSpace[' '] = isSpace['\r'] = isSpace['\n'] = isSpace['\t'] = true;
            isLineSep['\r'] = isLineSep['\n'] = true;
        }

        public MyInput(InputStream is) {
            in = new BufferedReader(new InputStreamReader(is));
        }

        public int read() {
            if (pos >= readLen) {
                pos = 0;
                try {
                    readLen = in.read(buffer);
                } catch (IOException e) {
                    throw new RuntimeException();
                }
                if (readLen <= 0) {
                    throw new MyInput.EndOfFileRuntimeException();
                }
            }
            return buffer[pos++];
        }

        public int nextInt() {
            int len = 0;
            str[len++] = nextChar();
            len = reads(len, isSpace);
            int i = 0;
            int ret = 0;
            if (str[0] == '-') {
                i = 1;
            }
            for (; i < len; i++) ret = ret * 10 + str[i] - '0';
            if (str[0] == '-') {
                ret = -ret;
            }
            return ret;
        }

        public char nextChar() {
            while (true) {
                final int c = read();
                if (!isSpace[c]) {
                    return (char) c;
                }
            }
        }

        int reads(int len, boolean[] accept) {
            try {
                while (true) {
                    final int c = read();
                    if (accept[c]) {
                        break;
                    }
                    if (str.length == len) {
                        char[] rep = new char[str.length * 3 / 2];
                        System.arraycopy(str, 0, rep, 0, str.length);
                        str = rep;
                    }
                    str[len++] = (char) c;
                }
            } catch (MyInput.EndOfFileRuntimeException e) {
            }
            return len;
        }

        static class EndOfFileRuntimeException extends RuntimeException {
        }

    }
}


import java.io.*;
import java.util.*;

public class Main {
    private static InputStream is;
    private static PrintWriter out;
    private static String INPUT = "";

    void solve() {
        int r = ni(), g = ni(), b = ni(), n = ni(), x = 0;
        int count[] = new int[n + 1];
        for (int i = 0; i <= n; i += r) {
            for (int j = 0; j <= n; j += g) {
                if (i + j > n) break;
                count[i + j]++;
            }
        }
        for (int i = 0; i <= n; ++i) {
            if ((n - i) % b == 0) x += count[i];
        }
        out.println(x);
    }

    public static void main(String[] args) throws Exception {
        is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
        out = new PrintWriter(System.out);
        new Main().solve();
        out.flush();
    }

    private static boolean eof() {
        if (lenbuf == -1) return true;
        int lptr = ptrbuf;
        while (lptr < lenbuf)
            if (!isSpaceChar(inbuf[lptr++])) return false;

        try {
            is.mark(1000);
            while (true) {
                int b = is.read();
                if (b == -1) {
                    is.reset();
                    return true;
                } else if (!isSpaceChar(b)) {
                    is.reset();
                    return false;
                }
            }
        } catch (IOException e) {
            return true;
        }
    }

    private static byte[] inbuf = new byte[1024];
    static int lenbuf = 0, ptrbuf = 0;

    private static int readByte() {
        if (lenbuf == -1) throw new InputMismatchException();
        if (ptrbuf >= lenbuf) {
            ptrbuf = 0;
            try {
                lenbuf = is.read(inbuf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (lenbuf <= 0) return -1;
        }
        return inbuf[ptrbuf++];
    }

    private static boolean isSpaceChar(int c) {
        return !(c >= 33 && c <= 126);
    }

    private static int skip() {
        int b;
        while ((b = readByte()) != -1 && isSpaceChar(b))
            ;
        return b;
    }

    private static double nd() {
        return Double.parseDouble(ns());
    }

    private static char nc() {
        return (char) skip();
    }

    private static String ns() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != ' ')
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private static char[] ns(int n) {
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while (p < n && !(isSpaceChar(b))) {
            buf[p++] = (char) b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }

    private static char[][] nm(int n, int m) {
        char[][] map = new char[n][];
        for (int i = 0; i < n; i++)
            map[i] = ns(m);
        return map;
    }

    private static int[] na(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = ni();
        return a;
    }

    private static long[] nal(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = nl();
        return a;
    }

    private static int ni() {
        int num = 0, b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
            ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }

        while (true) {
            if (b >= '0' && b <= '9') {
                num = num * 10 + (b - '0');
            } else {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private static long nl() {
        long num = 0;
        int b;
        boolean minus = false;
        while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
            ;
        if (b == '-') {
            minus = true;
            b = readByte();
        }

        while (true) {
            if (b >= '0' && b <= '9') {
                num = num * 10 + (b - '0');
            } else {
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private class XorShift {
        int x = 123456789;
        int y = 362436069;
        int z = 521288629;
        int w = 88675123;

        int nextInt(int n) {
            final int t = x ^ (x << 11);
            x = y;
            y = z;
            z = w;
            w = (w ^ (w >>> 19)) ^ (t ^ (t >>> 8));
            final int r = w % n;
            return r < 0 ? r + n : r;
        }
    }

    private static void tr(Object... o) {
        System.err.println(Arrays.deepToString(o));
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] args) {
		FastScanner sc = new FastScanner(System.in);
		int[] a = new int[3];
		a[0] = sc.nextInt();
		a[1] = sc.nextInt();
		a[2] = sc.nextInt();
		int n = sc.nextInt();
		Arrays.sort(a);
		long ans = 0;
		int m = n/a[2];
		for(int i = m; m >= 0; m--) {
			int x = n - m*a[2];
			int y = x/a[1];
			for(int j = y; j >= 0; j--) {
				if((x - y*a[1])%a[0] == 0) {
					ans++;
				}
			}
		}
		System.out.println(ans);
	}

	static class FastScanner {
		private BufferedReader reader = null;
	    private StringTokenizer tokenizer = null;
	    public FastScanner(InputStream in) {
	        reader = new BufferedReader(new InputStreamReader(in));
	        tokenizer = null;
	    }

	    public String next() {
	        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
	            try {
	                tokenizer = new StringTokenizer(reader.readLine());
	            } catch (IOException e) {
	                throw new RuntimeException(e);
	            }
	        }
	        return tokenizer.nextToken();
	    }

	    public String nextLine() {
	        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
	            try {
	                return reader.readLine();
	            } catch (IOException e) {
	                throw new RuntimeException(e);
	            }
	        }

	        return tokenizer.nextToken("\n");
	    }

	    public long nextLong() {
	        return Long.parseLong(next());
	    }

	    public int nextInt() {
	        return Integer.parseInt(next());
	    }

	    public double nextDouble() {
	         return Double.parseDouble(next());
	     }

	    public int[] nextIntArray(int n) {
	        int[] a = new int[n];
	        for (int i = 0; i < n; i++)
	            a[i] = nextInt();
	        return a;
	    }

	    public long[] nextLongArray(int n) {
	        long[] a = new long[n];
	        for (int i = 0; i < n; i++)
	            a[i] = nextLong();
	        return a;
	    }
	}
}


import java.util.*;

class Main{

  public static void main(String[] args){

    Scanner sc = new Scanner(System.in);
    int r = sc.nextInt();
    int g = sc.nextInt();
    int b = sc.nextInt();
    int n = sc.nextInt();
    int ans = 0;

    for(int i = 0; i <= n; i++){
	  for(int j = 0; j <= n; j++){
        for(int k = 0; k <= n; k++){
          if(r * i + g * j + b * k == n) ans++;
        }
      }
    }

    System.out.println(ans);

  }

}


import java.util.*;

class Main{

  public static void main(String[] args){

    Scanner sc = new Scanner(System.in);
    int r = sc.nextInt();
    int g = sc.nextInt();
    int b = sc.nextInt();
    int n = sc.nextInt();
    int ans = 0;

    for(int i = 0; i <= n; i++){
	  for(int j = 0; j <= n; j++){
        if((n - r * i - g * j) % b == 0) ans++;
      }
    }

    System.out.println(ans);

  }

}


#include <iostream>
#define MAXN 3000
using namespace std;

int R, G, B, N;
long long int num[MAXN+5];

int main() {
  cin >> R >> G >> B >> N;
  num[0] = 1;
  for (int i = R; i <= N; i++) {
    num[i] += num[i-R];
  }
  for (int i = G; i <= N; i++) {
    num[i] += num[i-G];
  }
  for (int i = B; i <= N; i++) {
    num[i] += num[i-B];
  }
  cout << num[N] << endl;
}


#include<bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define MAX_N 1002
#define i197 1000000007

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P1;
typedef pair<int,int> Pi;
typedef pair<double,Pi> Pdi;
typedef pair<ll,int>Pli;
typedef pair<P1,ll> P2;
const ll INF=100000000000000001;
struct edge{int to,cost;};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
struct Road{double cost;int a,b;};

ll dp[3001][4]={};

int main() {

	int r,g,b,n;
	cin>>r>>g>>b>>n;

	if(r<=n)dp[r][1]++;
	if(g<=n)dp[g][2]++;
	if(b<=n)dp[b][3]++;

	for(int j=1; j<=3; j++){
		int t;
		if(j==1)t=r;
		if(j==2)t=g;
		if(j==3)t=b;
		for(int i=1; i<=n; i++){
			dp[i][j]+=dp[i][j-1];
			if(dp[i][j]==0)continue;
			if(i+t<=n)dp[i+t][j]+=dp[i][j];
		}
	}
	cout<<dp[n][3]<<endl;

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
void fastIO(){
  ios_base::sync_with_stdio(0); cin.tie(0);
}

int main(){
  fastIO();
  int r,g,b,n;
  cin>>r>>g>>b>>n;
  vector<int>dp(3030);
  vector<int>change(3);
  change[0]=r,change[1]=g,change[2]=b;
  dp[0]=1;
  for(int i=0;i<3;i++){
  	for(int j=change[i];j<=n;j++){
  		dp[j]+=dp[j-change[i]];
  	}
  }
  cout<<dp[n]<<endl;
}


#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <map>
#include <iomanip>
#define intt long long

int main() {
	intt R, G, B, N; std::cin >> R >> G >> B >> N;
	intt ans = 0;
	for (intt i = 0; i < N / R; ++i) {
		for (intt j = 0; j < N / G; ++j) {
			if (i * R + j * G > N)
				continue;
			intt d = N - i * R - j * G;
			if (d % B != 0)
				continue;
			++ans;
		}
	}
	std::cout << ans << std::endl;
	return 0;
}


#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(v) v.begin(),v.end()
#define len(x) (ll)(x).length()
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int INF=1e9;
const ll INFS=1e18;
const int MOD=INF+7;
const int di[] = {-1,0,1,0};
const int dj[] = {0,-1,0,1};

int main() {
  int r,g,b,n;
  cin>>r>>g>>b>>n;
  int ans=0;
  for(int i=0;i<=n/r;i++){
    for(int j=0;j<=n/g;j++){
      for(int k=0;k<=n/b;k++){
        if(r*i+g*j+b*k==n) ans++;
      }
    }
  }
  cout<<ans<<endl;
}


#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define ll long long
#define P pair<ll,ll>
#define all(v) (v).begin(),(v).end()

const ll mod = 1e9+7;
const ll INF = 1e18;
const double pi = acos(-1);

int main(void)
{
    ll r,g,b,n,cnt=0; cin>>r>>g>>b>>n;
    rep(i,n/r+1){
        if(r*i > n) continue;
            rep(j,n/g+1){
            if(r*i+g*j > n) continue;
            rep(k,n/b+1){
                if(r*i+g*j+b*k > n) break;
                if(r*i+g*j+b*k == n) cnt++;
            }
        }
    }
    cout<<cnt<<endl;
    return 0;
}


#include <stdio.h>

int main(void) {
	// your code goes here
	int r[3],n;

	scanf("%d%d%d%d",&r[0],&r[1],&r[2],&n);
	int i,dp[n+1];
	for(i=0;i<n+1;i++)
		dp[i] = 0;
	dp[0] = 1;
	int j;
	for(i=0;i<3;i++)
		for(j=r[i];j<=n;j++)
			dp[j] = dp[j] + dp[j - r[i]];
	printf("%d\n",dp[n]);
	return 0;
}


#include<stdio.h>
#include<stdlib.h>
#include<stdint.h>
#include<inttypes.h>

typedef int32_t i32;

void trans (i32 a, i32 *dp, i32 n) {
  for (i32 i = a; i <= n; ++i) {
    dp[i] += dp[i - a];
  }
}

void run (void) {
  i32 a, b, c, n;
  scanf ("%" SCNi32 "%" SCNi32 "%" SCNi32 "%" SCNi32, &a, &b, &c, &n);
  i32 *dp = (i32 *) calloc (n + 1, sizeof (i32));
  dp[0] = 1;
  trans (a, dp, n);
  trans (b, dp, n);
  trans (c, dp, n);
  printf ("%" PRIi32 "\n", dp[n]);
}

int main (void) {
  run();
  return 0;
}


#include<stdio.h>

int gcd(int n,int m){
  if(n<m)return gcd(m,n);
  if(m==0)return n;
  return gcd(m,n%m);
}

#define lcm(a,b) ((a)*(b)/gcd((a),(b)))

int main (void){
  int r,g,b,n;
  scanf("%d %d %d %d",&r,&g,&b,&n);

  int r_max,ans=0;
  r_max=n/r;

  int i,j,nn,del;
  del=gcd(g,b);
  g/=del; b/=del;
  nn=n+r;
  for(i=0;i<=r_max;i++){
    nn=n-r*i;
    if(nn%del) continue;
    nn/=del;
    j=0;
    while(nn%b){
      nn-=g;
    }
    if(nn>=0)    ans+=(nn/b/g+1);
    //    printf("i:%d %d\n",i, ans);
  }

  printf("%d",ans);
  return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>

void swap (int *x, int *y) {
  int temp;

  temp = *x;
  *x = *y;
  *y = temp;

  return;
}

int gcd(int a, int b){
  int c;

  while (b > 0){
    c = a % b;
    a = b;
    b = c;
  }

  return a;
}

long int modpow(long int a,long int n,long int mod){
  long int ans=1;
  while(n>0){
    if(n & 1){
      ans=ans*a%mod;
    }
    a=a*a%mod;
    n/=2;
  }
  return ans;
}

long int modinv(long int a,long int mod){
  return modpow(a,mod-2,mod);
}

int max(int a,int b){
  if(a<b){
    return b;
  }
  else{
    return a;
  }
}

int min(int a,int b){
  if(a<b){
    return a;
  }
  else{
    return b;
  }
}

void chmax(int *a,int b){
  if(*a < b){
    *a = b;
  }

  return;
}

void chmin(int *a,int b){
  if(*a > b){
    *a =b;
  }

  return;
}

int main(void){
  int r,g,b,n;
  scanf("%d%d%d%d",&r,&g,&b,&n);
  int ans=0;
  for(int i=0;i<=(n/r)+1;i++){
    for(int j=0;j<=(n-r*i)+1/g;j++){
      if((n-(r*i+g*j))%b==0){
        ans++;
      }
    }
  }
  printf("%d\n",ans);
  return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>

void swap (int *x, int *y) {
  int temp;

  temp = *x;
  *x = *y;
  *y = temp;

  return;
}

int gcd(int a, int b){
  int c;

  while (b > 0){
    c = a % b;
    a = b;
    b = c;
  }

  return a;
}

long int modpow(long int a,long int n,long int mod){
  long int ans=1;
  while(n>0){
    if(n & 1){
      ans=ans*a%mod;
    }
    a=a*a%mod;
    n/=2;
  }
  return ans;
}

long int modinv(long int a,long int mod){
  return modpow(a,mod-2,mod);
}

int max(int a,int b){
  if(a<b){
    return b;
  }
  else{
    return a;
  }
}

int min(int a,int b){
  if(a<b){
    return a;
  }
  else{
    return b;
  }
}

void chmax(int *a,int b){
  if(*a < b){
    *a = b;
  }

  return;
}

void chmin(int *a,int b){
  if(*a > b){
    *a =b;
  }

  return;
}

int main(void){
  int r,g,b,n;
  scanf("%d%d%d%d",&r,&g,&b,&n);
  int ans=0;
  for(int i=0;i<=(n/r)+1;i++){
    for(int j=0;j<=(n-r*i)/g;j++){
      if((n-(r*i+g*j))%b==0){
        ans++;
      }
    }
  }
  printf("%d\n",ans);
  return 0;
}


'use strict'
function Main(input){
  input=input.trim().split(/\s+/).map(x=>x-0);
  const R=input[0],G=input[1],B=input[2],N=input[3];
  const dp=[[],[],[],[],];
  /*dp[i][j]はRGBの前からi色を使って
  のこりの玉をjにのする場合の数*/
  for(let i=0;i<=3;i++){
    for(let j=0;j<=N+R+G+B;j++){
      dp[i][j]=0;
    }
  }

  dp[0][N]=1;

  for(let i=1;i<=3;i++){
    for(let j=N;j>=0;j--){
      dp[i][j]+=dp[i-1][j]+dp[i][j+input[i-1]];
    }
  }
  console.log(dp[3][0]);
}

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


"use strict";
function I(t,i){this._s=t.split("\n"),this._c=0,this._l=0,this._f=i||Number}I.prototype.a=function(t){var i=this._s[this._l];if(i){var s=i.trim().split(" "),h=s[this._c];return this._c++,s.length===this._c&&(this._c=0,this._l++),t?t(h):this._f(h)}},I.prototype.l=function(t){var i=this._s[this._l];if(i)return this._c=0,this._l++,i.split(" ").map(t||this._f)},module.exports=I;

function main(input) {
  var o = new I(input);

  var R = o.a();
  var G = o.a();
  var B = o.a();
  var N = o.a();

  var count = 0;
  for (var r = 0; r <= N / R; r++) {
    for (var g = 0; g <= (N - r * R) / G; g++) {
      if ((N - r * R - g * G) % B === 0) count += 1;
    }
  }

  console.log(count);
}

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


function myOut(text){console.log(text);}//standard output
function Main(input) {
	input = input.trim();
	//input = input.trim().split(" ");
	//input = input.trim().split("\n");
	input = input.trim().split(" ").map((a)=>Number(a));
	//input = input.trim().split("\n").map((a)=>Number(a));

  var R = input[0];
  var G = input[1];
  var B = input[2];
  var N = input[3];
  var list = [R,G,B];
  var max = Math.max.apply(null,list);
  list.splice(list.indexOf(max), 1);
  var first = Math.floor(N / max);
  var next = Math.max.apply(null,list);
  var last = Math.min.apply(null,list);

  var output = 0;
  for(var i = 0; i <= first; i++){
    var tmp = N - (i * max);//残り10
    var tmp2 = Math.floor(tmp / next);
    if(i == 227){
       //console.log(tmp);
       }
    for(j = 0; j <= tmp2; j++){
      var tmp3 = tmp - (j * next);
      if(tmp3 % last == 0){
         output++
         }
    }

  }
  console.log(output);
}

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


function myOut(text){console.log(text);}//standard output
function Main(input) {
	input = input.trim();
	//input = input.trim().split(" ");
	//input = input.trim().split("\n");
	input = input.trim().split(" ").map((a)=>Number(a));
	//input = input.trim().split("\n").map((a)=>Number(a));

  var R = input[0];
  var G = input[1];
  var B = input[2];
  var N = input[3];
  var list = [R,G,B];
  var max = Math.max.apply(null,list);
  list.splice(list.indexOf(max), 1);
  var first = Math.floor(N / max);
  var next = Math.max.apply(null,list);
  var last = Math.min.apply(null,list);

  var output = 0;
  for(var i = 0; i <= first; i++){
    var tmp = N - (i * max);//残り10
    var tmp2 = Math.floor(tmp / next);
    if(tmp2 % last == 0){
       output += Math.floor(tmp2 / last) + 1;
      //console.log(Math.floor(tmp2 / last));
       }

  }
  console.log(output);
}

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


'use strict'

function Main(input) {
  const R = Number(input.split(" ")[0])
  const G = Number(input.split(" ")[1])
  const B = Number(input.split(" ")[2])
  const N = Number(input.split(" ")[3])

  const max = Math.max(R, G, B)
  const min = Math.min(R, G, B)
  const mid = [R, G, B].filter(x => x !== max && x !== min)[0]

  const maxDivided = Math.floor(N / max)

  let ans = 0
  for (let i=0; i<=maxDivided; i++) {
    const midDivided = Math.floor((N - (i * max)) / mid)
    for (let j=0; j<=midDivided; j++) {
      const reminder = N - (i * max) - (j * mid)
      if (reminder % min === 0) {
        ans++
      }
    }
  }

  console.log(ans)
}

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


'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'));


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func getNextLine(scanner *bufio.Reader) string {
	var buffer string
	for {
		line, isPrefix, _ := scanner.ReadLine()
		buffer += string(line)
		if isPrefix == false {
			break
		}
	}
	return buffer
}

func getIntList(scanner *bufio.Reader) []int {
	list := strings.Split(getNextLine(scanner), " ")
	l := len(list)
	result := make([]int, l)
	for i := 0; i < l; i++ {
		result[i], _ = strconv.Atoi(list[i])
	}
	return result
}

func main() {
	fp := os.Stdin
	if len(os.Args) > 1 {
		fp, _ = os.Open(os.Args[1])
	}

	scanner := bufio.NewReader(fp)

	var r, g, b, n int

	fmt.Sscan(getNextLine(scanner), &r, &g, &b, &n)

	arr := make([]int, n+1)
	ans := 0
	for i := 0; i <= n; i += r {
		for j := 0; j <= n; j += g {
			t := i + j
			if t > n {
				break
			}
			arr[t]++
		}
	}
	for i := 0; i <= n; i++ {
		for j := 0; j <= n; j += b {
			t := i + j
			if t > n {
				break
			}
			if t == n {
				ans += arr[i]
			}
		}
	}

	fmt.Println(ans)
}


package main

import "fmt"

func isInt(x float64) bool { return float64(int(x)) == x }

func main() {
	var r, g, b, n int
	fmt.Scan(&r, &g, &b, &n)
	bb := float64(b)

	ans := 0
	for i := 0; i <= n; i++ {
		for j := 0; i+j <= n; j++ {
			rest := float64(n - (r*i + g*j))
			if rest >= 0 && isInt(rest/bb) {
				ans++
			}
		}
	}
	fmt.Println(ans)
}


package main
import (
    "fmt"
)

func main(){
    var R, G, B, N int
    fmt.Scan(&R, &G, &B, &N)
    var ans int
    for i, hoge:=0, 0;R*i<=N;i++{
        hoge = N-R*i
        for hoge>=0{
            if hoge%B ==0 || hoge==0{
                ans++
            }
            hoge -= G
        }
    }
    fmt.Println(ans)
}


package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"reflect"
	"sort"
	"strconv"
	"strings"
	// "regexp"
)

/* sort */
type pair struct {
	index  int64
	p1, p2 interface{}
}
type pairs []pair

func (slice pairs) Len() int {
	return len(slice)
}

func (slice pairs) Less(i, j int) bool {
	return slice[i].index < slice[j].index
}

func (slice pairs) Swap(i, j int) {
	slice[i], slice[j] = slice[j], slice[i]
}

/* sort */
type Int64Slice []int64

func (slice Int64Slice) Len() int {
	return len(slice)
}

func (slice Int64Slice) Less(i, j int) bool {
	return slice[i] < slice[j]
}

func (slice Int64Slice) Swap(i, j int) {
	slice[i], slice[j] = slice[j], slice[i]
}
func Int64s(a []int64)                    { sort.Sort(Int64Slice(a)) }
func Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }

const (
	initialBufSize = 1e4
	maxBufSize     = 1e8
	INF            = 1e8
)

var (
	scanner = bufio.NewScanner(os.Stdin)
	writer  = bufio.NewWriter(os.Stdout)
	di      = []int64{-1, 0, 1, 0}
	dj      = []int64{0, -1, 0, 1}
	di8     = []int64{-1, -1, 0, 1, 1, 1, 0, -1}
	dj8     = []int64{0, -1, -1, -1, 0, 1, 1, 1}
)

func main() {
	buf := make([]byte, initialBufSize)
	scanner.Buffer(buf, maxBufSize)
	scanner.Split(bufio.ScanWords)
	R, G, B, N := readInt(), readInt(), readInt(), readInt()
	var ans int64
	for r := int64(0); r <= 3000; r++ {
		for g := int64(0); g <= 3000; g++ {
			var sum = R*r + G*g
			if N >= sum && (N-sum)%B == 0 {
				ans++
			}
		}
	}
	fmt.Println(ans)
}

/*==========================================
 *             Library
 *==========================================*/
func NextPermutation(x sort.Interface) bool {
	n := x.Len() - 1
	if n < 1 {
		return false
	}
	j := n - 1
	for ; !x.Less(j, j+1); j-- {
		if j == 0 {
			return false
		}
	}
	l := n
	for !x.Less(j, l) {
		l--
	}
	x.Swap(j, l)
	for k, l := j+1, n; k < l; {
		x.Swap(k, l)
		k++
		l--
	}
	return true
}
func doubleAry(h int64, w int64, init int64) (res [][]int64) {
	res = make([][]int64, h)
	for i := int64(0); i < h; i++ {
		res[i] = make([]int64, w)
		for j := int64(0); j < w; j++ {
			res[i][j] = init
		}
	}
	return
}

func aryEq(a []int64, b []int64) bool {
	return reflect.DeepEqual(a, b)
}

func clone(n []int64) (r []int64) {
	r = make([]int64, len(n))
	for i := 0; i < len(n); i++ {
		r[i] = n[i]
	}
	return
}
func write(s string) {
	writer.WriteString(s)
}

func print() {
	writer.Flush()
}

// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可
func readLine() (s string) {
	if scanner.Scan() {
		s = scanner.Text()
	}
	return s
}

func readInt() (read int64) {
	scanner.Scan()
	read, err := strconv.ParseInt(scanner.Text(), 10, 64)
	if err != nil {
		panic(err)
	}
	return
}

func readFloat() (read float64) {
	scanner.Scan()
	read, err := strconv.ParseFloat(scanner.Text(), 64)
	if err != nil {
		panic(err)
	}
	return
}

func readRunes() (read []rune) {
	scanner.Scan()
	for _, v := range scanner.Text() {
		read = append(read, v)
	}
	return
}

func readString() (read string) {
	scanner.Scan()
	read = scanner.Text()
	return
}

func readStrings() (read []string) {
	scanner.Scan()
	for _, v := range scanner.Text() {
		read = append(read, string(v))
	}
	return
}

func s2i(s string) int64 {
	var intVal, e = strconv.ParseInt(s, 10, 64)
	if e != nil {
		panic(e)
	}
	return intVal
}

func i2s(i int64) string {
	var strVal = strconv.FormatInt(i, 10)
	return strVal
}

func s2f(s string) float64 {
	var floatVal, e = strconv.ParseFloat(s, 64)
	if e != nil {
		panic(e)
	}
	return floatVal
}

func abs(i int64) int64 {
	return int64(math.Abs(float64(i)))
}

func max(a ...int64) int64 {
	ans := int64(0)
	for i, v := range a {
		if i == 0 {
			ans = v
		}
		if ans < v {
			ans = v
		}
	}
	return ans
}
func min(a ...int64) int64 {
	ans := int64(0)
	for i, v := range a {
		if i == 0 {
			ans = v
		}
		if ans > v {
			ans = v
		}
	}
	return ans
}

func sum(i []int64) int64 {
	sum := int64(0)
	for _, val := range i {
		sum += val
	}
	return sum
}

func split(s string) []string {
	return strings.Fields(s)
}

func strAry2intAry(strs []string) []int64 {
	var ret = make([]int64, 0, len(strs))
	for _, str := range strs {
		var intVal = s2i(str)
		ret = append(ret, intVal)
	}
	return ret
}

func intAry2strAry(nums []int64) []string {
	var ret = make([]string, 0, len(nums))
	for _, num := range nums {
		var strVal = i2s(num)
		ret = append(ret, strVal)
	}
	return ret
}

func ary2str(strs []string) string {
	return strings.Join(strs, " ")
}

func reverse(res []int64) []int64 {
	for i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {
		res[i], res[j] = res[j], res[i]
	}
	return res
}
func reverseStr(res []string) []string {
	for i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {
		res[i], res[j] = res[j], res[i]
	}
	return res
}

func ini(res []int, init int) {
	if len(res) == 0 {
		return
	}
	res[0] = init
	for i := 0; i < len(res); i++ {
		copy(res[i:], res[:i])
	}
}

//
// func regexpExample() {
//     // Your code here!
//     var str = "13:20"
//     r := regexp.MustCompile(`(\d+):(\d+)`)
//     fmt.Println(r.FindStringSubmatch(str))
// }

// type Country struct {
//     gold int
//     silver int
//     blonze int
// }

// // 複数ソートのサンプル
// func stableSortExample() []Country{
//     var country = []Country {
//         {gold:1, silver:2, blonze:3},
//         {gold:1, silver:2, blonze:3},
//         {gold:1, silver:3, blonze:2},
//         {gold:1, silver:3, blonze:3},
//     }
//     sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })
//     sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })
//     sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })
//     return country
// }
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"reflect"
	"sort"
	"strconv"
	"strings"
	// "regexp"
)

/* sort */
type pair struct {
	index  int64
	p1, p2 interface{}
}
type pairs []pair

func (slice pairs) Len() int {
	return len(slice)
}

func (slice pairs) Less(i, j int) bool {
	return slice[i].index < slice[j].index
}

func (slice pairs) Swap(i, j int) {
	slice[i], slice[j] = slice[j], slice[i]
}

/* sort */
type Int64Slice []int64

func (slice Int64Slice) Len() int {
	return len(slice)
}

func (slice Int64Slice) Less(i, j int) bool {
	return slice[i] < slice[j]
}

func (slice Int64Slice) Swap(i, j int) {
	slice[i], slice[j] = slice[j], slice[i]
}
func Int64s(a []int64)                    { sort.Sort(Int64Slice(a)) }
func Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }

const (
	initialBufSize = 1e4
	maxBufSize     = 1e8
	INF            = 1e8
)

var (
	scanner = bufio.NewScanner(os.Stdin)
	writer  = bufio.NewWriter(os.Stdout)
	di      = []int64{-1, 0, 1, 0}
	dj      = []int64{0, -1, 0, 1}
	di8     = []int64{-1, -1, 0, 1, 1, 1, 0, -1}
	dj8     = []int64{0, -1, -1, -1, 0, 1, 1, 1}
)

func main() {
	buf := make([]byte, initialBufSize)
	scanner.Buffer(buf, maxBufSize)
	scanner.Split(bufio.ScanWords)
	R, G, B, N := readInt(), readInt(), readInt(), readInt()
	var ans int64
	for r := int64(0); r <= 3000; r++ {
		for g := int64(0); g <= 3000; g++ {
			var sum = R*r + G*g
			if N >= sum && (N-sum)%B == 0 {
				ans++
			}
		}
	}
	fmt.Println(ans)
}

/*==========================================
 *             Library
 *==========================================*/
func NextPermutation(x sort.Interface) bool {
	n := x.Len() - 1
	if n < 1 {
		return false
	}
	j := n - 1
	for ; !x.Less(j, j+1); j-- {
		if j == 0 {
			return false
		}
	}
	l := n
	for !x.Less(j, l) {
		l--
	}
	x.Swap(j, l)
	for k, l := j+1, n; k < l; {
		x.Swap(k, l)
		k++
		l--
	}
	return true
}
func doubleAry(h int64, w int64, init int64) (res [][]int64) {
	res = make([][]int64, h)
	for i := int64(0); i < h; i++ {
		res[i] = make([]int64, w)
		for j := int64(0); j < w; j++ {
			res[i][j] = init
		}
	}
	return
}

func aryEq(a []int64, b []int64) bool {
	return reflect.DeepEqual(a, b)
}

func clone(n []int64) (r []int64) {
	r = make([]int64, len(n))
	for i := 0; i < len(n); i++ {
		r[i] = n[i]
	}
	return
}
func write(s string) {
	writer.WriteString(s)
}

func print() {
	writer.Flush()
}

// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可
func readLine() (s string) {
	if scanner.Scan() {
		s = scanner.Text()
	}
	return s
}

func readInt() (read int64) {
	scanner.Scan()
	read, err := strconv.ParseInt(scanner.Text(), 10, 64)
	if err != nil {
		panic(err)
	}
	return
}

func readFloat() (read float64) {
	scanner.Scan()
	read, err := strconv.ParseFloat(scanner.Text(), 64)
	if err != nil {
		panic(err)
	}
	return
}

func readRunes() (read []rune) {
	scanner.Scan()
	for _, v := range scanner.Text() {
		read = append(read, v)
	}
	return
}

func readString() (read string) {
	scanner.Scan()
	read = scanner.Text()
	return
}

func readStrings() (read []string) {
	scanner.Scan()
	for _, v := range scanner.Text() {
		read = append(read, string(v))
	}
	return
}

func s2i(s string) int64 {
	var intVal, e = strconv.ParseInt(s, 10, 64)
	if e != nil {
		panic(e)
	}
	return intVal
}

func i2s(i int64) string {
	var strVal = strconv.FormatInt(i, 10)
	return strVal
}

func s2f(s string) float64 {
	var floatVal, e = strconv.ParseFloat(s, 64)
	if e != nil {
		panic(e)
	}
	return floatVal
}

func abs(i int64) int64 {
	return int64(math.Abs(float64(i)))
}

func max(a ...int64) int64 {
	ans := int64(0)
	for i, v := range a {
		if i == 0 {
			ans = v
		}
		if ans < v {
			ans = v
		}
	}
	return ans
}
func min(a ...int64) int64 {
	ans := int64(0)
	for i, v := range a {
		if i == 0 {
			ans = v
		}
		if ans > v {
			ans = v
		}
	}
	return ans
}

func sum(i []int64) int64 {
	sum := int64(0)
	for _, val := range i {
		sum += val
	}
	return sum
}

func split(s string) []string {
	return strings.Fields(s)
}

func strAry2intAry(strs []string) []int64 {
	var ret = make([]int64, 0, len(strs))
	for _, str := range strs {
		var intVal = s2i(str)
		ret = append(ret, intVal)
	}
	return ret
}

func intAry2strAry(nums []int64) []string {
	var ret = make([]string, 0, len(nums))
	for _, num := range nums {
		var strVal = i2s(num)
		ret = append(ret, strVal)
	}
	return ret
}

func ary2str(strs []string) string {
	return strings.Join(strs, " ")
}

func reverse(res []int64) []int64 {
	for i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {
		res[i], res[j] = res[j], res[i]
	}
	return res
}
func reverseStr(res []string) []string {
	for i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {
		res[i], res[j] = res[j], res[i]
	}
	return res
}

func ini(res []int, init int) {
	if len(res) == 0 {
		return
	}
	res[0] = init
	for i := 0; i < len(res); i++ {
		copy(res[i:], res[:i])
	}
}

//
// func regexpExample() {
//     // Your code here!
//     var str = "13:20"
//     r := regexp.MustCompile(`(\d+):(\d+)`)
//     fmt.Println(r.FindStringSubmatch(str))
// }

// type Country struct {
//     gold int
//     silver int
//     blonze int
// }

// // 複数ソートのサンプル
// func stableSortExample() []Country{
//     var country = []Country {
//         {gold:1, silver:2, blonze:3},
//         {gold:1, silver:2, blonze:3},
//         {gold:1, silver:3, blonze:2},
//         {gold:1, silver:3, blonze:3},
//     }
//     sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })
//     sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })
//     sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })
//     return country
// }


package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

//Util
func nextStr() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func maxInt(a, b int) int {
	if a > b {
		return a
	} else {
		return b
	}
}

func minInt(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}

func absInt(a int) int {
	if a >= 0 {
		return a
	} else {
		return -a
	}
}

func absFloat64(a float64) float64 {
	if a >= 0 {
		return a
	} else {
		return -a
	}
}

func maxFloat64(a, b float64) float64 {
	if a > b {
		return a
	} else {
		return b
	}
}

func minFloat64(a, b float64) float64 {
	if a > b {
		return b
	} else {
		return a
	}
}

func str2Int(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}

func reverse(s string) string {
	runes := []rune(s)
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}
	return string(runes)
}

func powInt(p, q int) int {
	return int(math.Pow(float64(p), float64(q)))
}

func isPrime(x int) bool {
	if x == 1 {
		return false
	}
	if x == 2 {
		return true
	}
	if x%2 == 0 {
		return false
	}

	b := true
	rootx := int(math.Sqrt(float64(x)))
	i := 3
	for i <= rootx {
		if x%i == 0 {
			b = false
			break
		}
		i += 2
	}
	return b
}

func PrimeFactors(n int) (pfs []int) {
	// Get the number of 2s that divide n
	for n%2 == 0 {
		pfs = append(pfs, 2)
		n = n / 2
	}

	// n must be odd at this point. so we can skip one element
	// (note i = i + 2)
	for i := 3; i*i <= n; i = i + 2 {
		// while i divides n, append i and divide n
		for n%i == 0 {
			pfs = append(pfs, i)
			n = n / i
		}
	}

	// This condition is to handle the case when n is a prime number
	// greater than 2
	if n > 2 {
		pfs = append(pfs, n)
	}

	return
}

func sumInts(x []int) int {

	total := 0
	for _, v := range x {
		total += v
	}

	return total
}

//Main
const (
	initialBufSize = 10000
	maxBufSize     = 1000000
	mod            = 1e9 + 7
)

var (
	sc *bufio.Scanner = func() *bufio.Scanner {
		sc := bufio.NewScanner(os.Stdin)
		buf := make([]byte, initialBufSize)
		sc.Buffer(buf, maxBufSize)
		return sc
	}()
)

var R, G, B, N int

func main() {
	sc.Split(bufio.ScanWords)

	R, G, B, N = nextInt(), nextInt(), nextInt(), nextInt()
	ans := 0
	for r := 0; r <= N/R; r++ {
		for g := 0; g <= N/G; g++ {
			for b := 0; b <= N/B; b++ {
				if R*r+B*b+G*g == N {
					ans++
				}
			}
		}
	}
	fmt.Println(ans)
}


package main

import (
	"fmt"
)

func main() {
	var r, g, b, n int
	fmt.Scan(&r, &g, &b, &n)

	ans := 0
	for x := 0; x <= n; x++ {
		for y := 0; y <= n; y++ {
			for z := 0; z <= n; z++ {
				if r*x+g*y+b*z == n {
					ans++
				}
			}
		}
	}

	fmt.Print(ans)
}


def valid?(current, stride, n)
  return false if current > n
  diff = n - current
  diff % stride == 0
end

r, g, b, n = gets.split.map(&:to_i)
nums = [r, g, b]
nums = nums.sort.reverse
maxes = nums.map do |num|
  ((n + num - 1) / num).to_i
end
ans = 0
count = 0
while count <= n
  rest = n - count
  c2 = 0
  valids = []
  while c2 <= rest && valids.length < 2
    if valid?(c2 + count, nums[2], n)
      valids << c2
    end
    c2 += nums[1]
  end
  if valids.length == 1
    ans += 1
  elsif valids.length == 2
    diff = valids[1] - valids[0]
    r = rest - valids[1]
    ans += 2
    ans += (r / diff)
  end
  count += nums[0]
end

puts ans


R, G, B, N = gets.strip.split(/ /).collect(&:to_i)

$cache = []
def countGB(n)
	if count = $cache[n]
		return count
	end
	x = 0
	count = 0
	while x <= n
		if (n - x) % B == 0
			count += 1
		end
		x += G
	end

	$cache[n] = count
end

x = 0
count = 0
while x <= N
	count += countGB(N - x)
	x += R
end

puts count


r,g,b,n=gets.split.map(&:to_i)

x,y,z=[r,g,b].sort

count=0

xs=0
while xs<=n
  ys=0
  while ys+xs<=n
    count+=1 if (n-(ys+xs))%z==0
    ys+=y
  end
  xs+=x
end

puts count


r, g, b, n = gets.chomp.split.map(&:to_i)
gc = (r.gcd(g)).gcd(b)
r /= gc
g /= gc
b /= gc
n /= gc
r, g, b = [r, g, b].sort

res = 0
0.step(n / b) do |k|
  0.step((n - k * b) / g) do |j|
    res += 1
  end
end
puts res


#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int main(void)
{
  ll R,G,B,N;
  cin >>R>>G>>B>>N;
  ll ans=0;
  for(ll r=0;r*R<N;r++) {
    for(ll g=0;g*G<N;g++) {
      ll bn=N-r*R-g*G;
      if(bn>=0&&bn<=N&&bn%B==0){
        ans++;
      }
    }
  }
  cout << ans << endl;
}


r,g,b,n = gets.split.map(&:to_i)
# p [r,g,b,n]

bb = (0..(n / b))
# p bb
# puts
cnt = 0
(n / r + 1).times do |rr|
  (n / g + 1).times do |gg|
    # p [rr * r,gg*g]
    next if rr*r + gg*g >= n+1
    if 0 <= (n - (rr*r + gg*g))/b && (n - (rr*r + gg*g))/b <= (n / b) && (n - (rr*r + gg*g)) % b == 0
      cnt += 1
    end
    # if x = bb.bsearch{|x| x*b >= n - (rr*r + gg*g)}
    #   cnt += 1 if x*b == n - (rr*r + gg*g)
    # end
  end
end
p cnt
# 4 87058


use std::io::*;
use std::str::FromStr;

#[allow(unused_macros)]
macro_rules! scan {
  ($e:expr; $t:ty) => {
    $e.get::<$t>()
  };
  ($e:expr; $($t:ty), *) => {
    ($($e.get::<$t>(),)*)
  };
  ($e:expr => $i:expr; $t:ty) => {
    (0..$i).map(|_| $e.get::<$t>()).collect::<Vec<$t>>()
  };
  ($e:expr => $row:expr, $col:expr; $t:ty) => {
    (0..$i).map(|_| scan!($e => $col; $t)).collect::<Vec<$t>>()
  }
}

struct Scanner<R: Read> {
  reader: R
}

#[allow(dead_code)]
impl<R: Read> Scanner<R> {
  fn new(reader: R) -> Scanner<R> {
    Scanner { reader: reader }
  }
  fn safe_get<T: FromStr>(&mut self) -> Option<T> {
    let token = self.reader.by_ref().bytes().map(|c| c.unwrap() as char)
      .skip_while(|c| c.is_whitespace())
      .take_while(|c| !c.is_whitespace())
      .collect::<String>();
    if token.is_empty() { None } else { token.parse().ok() }
  }
  fn get<T: FromStr>(&mut self) -> T {
    if let Some(v) = self.safe_get() { v } else {
      writeln!(stderr(), "Terminated with EOF").unwrap();
      std::process::exit(0);
    }
  }
}

trait Writable {
  fn write(&self, sep: &'static str) -> String;
}

impl<T: ToString> Writable for Vec<T> {
  fn write(&self, sep: &'static str) -> String {
    self.iter().map(|e| e.to_string()).collect::<Vec<String>>().join(sep)
  }
}

fn main() {
  let cin = stdin();
  let cin = cin.lock();
  let mut sc = Scanner::new(cin);
  let (r, g, b, n) = scan!(sc; i32, i32, i32, i32);
  let mut ans = 0;
  for rb in 0..(n / r) + 1 {
    for gb in 0..((n - r * rb) / g) + 1 {
      if (n - r * rb - g * gb) % b == 0 {
        ans += 1;
      }
    }
  }
  println!("{}", ans);
}


fn main() {
    let mut input: String = String::new();
    let stdin = std::io::stdin();
    let _ = stdin.read_line(&mut input);
    let rgbn = input
        .trim()
        .split_whitespace()
        .map(|n| n.parse().expect("parse"))
        .collect::<Vec<u32>>();
    println!("{}", solve(rgbn[0], rgbn[1], rgbn[2], rgbn[3]));
}

fn solve(r: u32, g: u32, b: u32, n: u32) -> u32 {
    // no brain
    let mut ans = 0;
    for buy_r in 0..=(n / r) {
        for buy_g in 0..=((n - r * buy_r) / g) {
            if (n - r * buy_r - g * buy_g) % b == 0 {
                ans += 1;
            }
        }
    }
    ans
}


macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        r: i32,
        g: i32,
        b: i32,
        n: i32,
    }
    let mut ans = 0;
    for i in 0..n / r + 1 {
        let mut balls = r * i;
        for j in 0..(n - balls) / g + 1 {
            balls = r * i + g * j;
            if balls + b * ((n - balls) / b) == n { ans += 1; }
        }
    }
    println!("{}", ans)
}


use whiteread::parse_line;

/*
fn calc(n: usize, r: usize, g: usize, b: usize, dp: &mut Vec<usize>) -> usize {
    if dp[n] == std::usize::MAX {
        let mut res = 0;
        if n >= r {
            res += dp[n - r];
        }
    }
    dp[n]
}
*/

fn main() {
    let (r, g, b, n): (usize, usize, usize, usize) = parse_line().unwrap();
    let mut cnt = 0;
    //let mut dp: Vec<usize> = vec![std::usize::MAX; n + 1];

    //println!("{}", calc(n, r, g, b, &mut dp));
    for x in 0..=3000 {
        if x > n {
            break;
        }
        for y in 0..=3000 {
            if x * r + y * b > n {
                break;
            }
            for z in 0..=3000 {
                if x * r + y * b + z * g > n {
                    break;
                }
                if x * r + y * b + z * g == n {
                    cnt += 1;
                }
            }
        }
    }
    println!("{}", cnt);
}


macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        r: i32,
        g: i32,
        b: i32,
        n: i32,
    }
    let mut ans = 0;
    for i in 0..n / r + 1 {
        let mut balls = r * i;
        for j in 0..(n - balls) / g + 1 {
            balls = r * i + g * j;
            for k in 0..(n - balls) / b + 1 {
                if balls + b * k == n { ans += 1; }
            }
        }
    }
    println!("{}", ans)
}


macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        r: i32,
        g: i32,
        b: i32,
        n: i32,
    }
    let mut ans = 0;
    for i in 0..n / r + 1 {
        for j in 0..n / g + 1 {
            for k in 0..n / b + 1 {
                if r * i + g * j + b * k == n { ans += 1; }
            }
        }
    }
    println!("{}", ans)
}


let input = readLine()!.characters.split(" ").map{Int(String($0))!}
let (R,G,B,N) = (input[0],input[1],input[2],input[3])
var ans = 0
for r in 0...N {
    for g in 0...N {
        let b = N-r*R-g*G
        if b>=0 && b%B==0 {
            ans += 1
        }
    }
}
print(ans)


let input = readLine()!.characters.split(" ").map{Int(String($0))!}
let (R, G, B, N) = (input[0], input[1], input[2], input[3])
var ans = 0
for r in 0...N {
    for g in 0...N {
        let b = N - (r*R + g*G)
        if (b >= 0) && (b % B == 0) {
            ans += 1
        }
    }
}
print(ans)


let i=readLine()!.characters.split(" ").map{Int(String($0))!},N=i[3]
var ans=0
for r in 0...N {
    for g in 0...N {
        let b = N-r*i[0]-g*i[1]
        if b>=0&&b%i[2]==0 {
            ans++
        }
    }
}
print(ans)


let input = readLine()!.characters.split(" ").map{Int(String($0))}
let (R, G, B, N) = (input[0], input[1], input[2], input[3])
var ans = 0
for r in 0...N {
    for g in 0...N {
        let b = N - (r*R + g*G)
        if b >= 0 && b%B == 0 {
            ans += 1
        }
    }
}
print(ans)


let arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}

var r: Int = 0, g: Int = 0, b: Int = 0
var i: Int = 0
var j: Int = 0
var k: Int = 0
var o: Int = 0

var z: Int = ( arr[3] / arr[0] )
var x: Int = ( arr[3] / arr[1] )
var c: Int = ( arr[3] / arr[2] )

for r = 0; r <= ( z ); r += 1 {
  if( ( i ) > arr[3] ) {
    break
  }
  j = 0
  for g = 0; g <= ( x ); g += 1 {
    if( ( i + j ) > arr[3] ) {
      break
    }
    k = 0
    for b = 0; b <= ( c ); b += 1 {
      if( ( i + j + k ) > arr[3] ) {
        break
      }
      if ( ( i + j + k )  == arr[3] ) {
        o += 1
      }
      k =  k + arr[2]
    }
    j = j + arr[1]
  }
  i = i + arr[0]
}

print( o )


let arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}

var r: Int = 0, g: Int = 0, b: Int = 0
var i: Int = 0
var j: Int = 0
var k: Int = 0
var o: Int = 0

var z: Int = ( arr[3] / arr[0] )
var x: Int = ( arr[3] / arr[1] )
var c: Int = ( arr[3] / arr[2] )

for r = 0; r <= ( z ); r += 1 {
  if( ( i ) > arr[3] ) {
    continue
  }
  j = 0
  for g = 0; g <= ( x ); g += 1 {
    if( ( i + j ) > arr[3] ) {
      continue
    }
    k = 0
    for b = 0; b <= ( c ); b += 1 {
      if( ( i + j + k ) > arr[3] ) {
        break
      }
      if ( ( i + j + k )  == arr[3] ) {
        o += 1
      }
      k =  k + arr[2]
    }
    j = j + arr[1]
  }
  i = i + arr[0]
}

print( o )


function readInt(str){
  return parseInt(str, 10);
}
function solve(R,G,B,N){
  let count=0;
  for(let r=0;r<=N;r+=R)
    for(let g=0;r+g<=N;g+=G)
      {
        if((N-r-g)%B==0)count++;
      }
  return count;
}
function Main(raw: string) {
  const input = raw.split(/ |\n/);
  const [R,G,B,N] = input.map(readInt);
  //出力
  console.log(solve(R,G,B,N));
}

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


function readInt(str){
  return parseInt(str, 10);
}
function solve(R,G,B,N){
  let count=0;
  for(let r=0;r<=N;r+=R)
    for(let g=0;r+g<=N;g+=G)
      {
        if((N-r-g)%B==0)count++;
      }
  return count;
}
function Main(raw: string) {
  const input = raw.split("\n");
  const [R,G,B,N] = input[0].split(" ").map(readInt);
  //出力
  console.log(solve(R,G,B,N));
}

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


function Main(input) {
    const [R, G, B, n] = input.split(" ").map(num => Number(num));
    const maxR = Math.ceil(n / R);
    // const maxG = Math.ceil(n / G);
    // const maxB = Math.ceil(n / B);
    let result = 0;
    for (let r = 0; r <= maxR; r++) {
        const sumR = r * R;
        const maxG = Math.ceil((n - sumR) / G);
        for (let g = 0; g <= maxG; g++) {
            const sumRG = sumR + g * G;
            const remain = n - sumRG;
            if (remain < 0) break;
            if (remain % B === 0) result++;
        }
    }
    console.log(result);
}

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


function Main(input) {
    const [R, G, B, n] = input.split(" ").map(num => Number(num));
    const maxR = Math.ceil(n / R);
    // const maxG = Math.ceil(n / G);
    // const maxB = Math.ceil(n / B);
    let result = 0;
    for (let r = 0; r <= maxR; r++) {
        const sumR = r * R;
        const maxG = Math.ceil((n - sumR) / G);
        for (let g = 0; g <= maxG; g++) {
            const sumRG = sumR + g * G;
            if ((n - sumRG) % B === 0) result++;
        }
    }
    console.log(result);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));
function Main(input) {
    const [R, G, B, n] = input.split(" ").map(num => Number(num));
    const maxR = Math.ceil(n / R);
    let result = 0;
    for (let r = 0; r <= maxR; r++) {
        const sumR = r * R;
        const maxG = Math.ceil((n - sumR) / G);
        for (let g = 0; g <= maxG; g++) {
            const sumRG = sumR + g * G;
            const remain = n - sumRG;
            if (remain < 0) break;
            if (remain % B === 0) result++;
        }
    }
    console.log(result);
}

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


function Main(input) {
    const [R, G, B, n] = input.split(" ").map(num => Number(num));
    const maxR = Math.ceil(n / R);
    // const maxG = Math.ceil(n / G);
    // const maxB = Math.ceil(n / B);
    let result = 0;
    for (let r = 0; r <= maxR; r++) {
        const sumR = r * R;
        const maxG = Math.ceil((n - sumR) / G);
        for (let g = 0; g <= maxG; g++) {
            const sumRG = sumR + g * G;
            if ((n - sumRG) % B === 0) result++;
        }
    }
    console.log(result);
}

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


function Main(input) {
    const [R, G, B, n] = input.split(" ").map(num => Number(num));
    const maxR = Math.ceil(n / R);
    let result = 0;
    for (let r = 0; r <= maxR; r++) {
        const sumR = r * R;
        const maxG = Math.ceil((n - sumR) / G);
        for (let g = 0; g <= maxG; g++) {
            const sumRG = sumR + g * G;
            const maxB = Math.ceil((n - sumRG) / B);
            for (let b = 0; b <= maxB; b++) {
                const sum = sumRG + b * B;
                if (n <= sum) {
                    if (n === sum) result++;
                    break;
                }
            }
        }
    }
    console.log(result);
}

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


L, R, d = map(int, input().split())
a = 0

for i in range(L,R+1):
  if i%d==0:
    a += 1
  else:
    a += 0

print(a)


L,R,d = map(int,input().split())
cnt=0
for i in range(L, R+1):
    if i%d == 0:
        cnt +=1
print(cnt)


a,b,c = map(int,input().split())
print(b//c - (a-1)//c)


import math

l = int(input())
r = int(input())
d = int(input())

min = math.floor(l/d)
max = math.floor(r/d)
if math.floor(l/d) == l/d:
  p = 1
else:
  p = 0
print(max - min + p)


#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <string>
#include <ctype.h>
#include <cstdlib>
#include <cmath>
#include <stack>
#include <numeric>
#include <map>
#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;

int main()
{
    int l,r,d;
    cin >> l >> r >> d;
    int cnt = 0;
    for (int i = l; i <= r; i++)
    {
        if (i%d == 0)
        {
            cnt++;
        }

    }
    cout << cnt << endl;
}


import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
from math import sqrt
from collections import defaultdict
def main():
    n = int(input())
    n2 = int(sqrt(n) + 1)
    d1 = defaultdict(int)

    for i1 in range(1, n2):
        for i2 in range(1, n2):
            for i3 in range(1, n2):
                #p = (i1 + i2) ** 2 - (i1 * i2) + i3 * (i1 + i2 + i3)
                p = i1 ** 2 + i2 ** 2 + i3 ** 2 + i1 * i2 + i2 * i3 + i1 * i3
                d1[p] += 1

    for j1 in range(1, n + 1):
        print(d1[j1])

if __name__ == '__main__':
    main()


import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        PrintWriter w = new PrintWriter(System.out);
        int l = in.nextInt();
        int r = in.nextInt();
        int n = in.nextInt();
        w.println((r / n) - ((l - 1) / n));
        w.close();
    }

    static class InputReader {

        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = this.nextInt();
            }
            return a;
        }

        public long[] nextLongArray(int n) {
            long a[] = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = this.nextLong();
            }
            return a;
        }

        public String readString() {
            int c = snext();
            while (isSpaceChar(c)) {
                c = snext();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public String nextLine() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.TreeSet;

public class Main {
  public static void main(String[] args) {
    InputReader sc = new InputReader(System.in);

    int n = sc.nextInt();
    int m = sc.nextInt();
    int d = sc.nextInt();

    int ans = 0;
    for(int i = n; i <= m; i++){
      if(i % d == 0){
        ans++;
      }
    }
    System.out.println(ans);

  }

 //ここからテンプレ
  static class InputReader {
      private InputStream stream;
      private byte[] buf = new byte[1024];
      private int curChar;
      private int numChars;
      private SpaceCharFilter filter;

      public InputReader(InputStream stream) {
          this.stream = stream;
      }

      public int next() {
          if (numChars == -1)
              throw new InputMismatchException();
          if (curChar >= numChars) {
              curChar = 0;
              try {
                  numChars = stream.read(buf);
              } catch (IOException e) {
                  throw new InputMismatchException();
              }
              if (numChars <= 0)
                  return -1;
          }
          return buf[curChar++];
      }

      public String nextStr() {
        int c = next();
        while(isSpaceChar(c)){c = next();}
        StringBuffer str = new StringBuffer();
        do{
          str.append((char)c);
          c = next();
        }while(!isSpaceChar(c));
        return str.toString();
      }

      public char nextChar() {
        int c = next();
        while(isSpaceChar(c)){c = next();}
        char ret;
        do{
          ret = (char)c;
          c = next();
        }while(!isSpaceChar(c));
        return ret;
      }

      public int nextInt() {
          int c = next();
          while (isSpaceChar(c))
              c = next();
          int sgn = 1;
          if (c == '-') {
              sgn = -1;
              c = next();
          }
          int res = 0;
          do {
              if (c < '0' || c > '9')
                  throw new InputMismatchException();
              res *= 10;
              res += c - '0';
              c = next();
          } while (!isSpaceChar(c));
          return res * sgn;
      }

      public boolean isSpaceChar(int c) {
          if (filter != null)
              return filter.isSpaceChar(c);
          return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
      }

      public interface SpaceCharFilter {
          public boolean isSpaceChar(int ch);
      }
  }
}


import java.util.*;
import java.util.stream.Collectors;
import java.io.*;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;

public class Main {

	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		Main ins = new Main(in);
		ins.calc();
		ins.showResult();
	}

	Main(BufferedReader in) throws IOException {
		String[] tokens = in.readLine().split(" ");
		int L = Integer.parseInt(tokens[0]);
		int R = Integer.parseInt(tokens[1]);
		int d = Integer.parseInt(tokens[2]);
		int count = 0;
		for (int i = L; i <= R; ++i) {
			if (i % d == 0)
				++count;
		}
		System.out.println(count);
	}

	void calc() {
	}

	void showResult() {
	}
}


import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc  = new Scanner(System.in);
		int L = Integer.parseInt(sc.next());
		int R = Integer.parseInt(sc.next());
		int d = Integer.parseInt(sc.next());
		int x = R/d;
		int y = L/d;
		System.out.println(x-y);

	}

}


package エイシングプログラミングコンテスト2020;

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc  = new Scanner(System.in);
		int L = Integer.parseInt(sc.next());
		int R = Integer.parseInt(sc.next());
		int d = Integer.parseInt(sc.next());
		int x = R/d;
		int y = L/d;
		System.out.println(x-y);

	}

}


import java.util.Scanner;

public class test {
    public static int valid(long x, long y,long z,long n){
        return (z*z+x*x+y*y+y*z+x*y+x*z==n?1:0);
    }
    public static int solve(int n){
        int ans=0;
        for (long x = 1; x*x+x*2 <= n ; x++) {
            for (long y = 1; y*y+x*y+x*x+x+y <= n ; y++) {
                for (long z = 1; z*z+x*x+y*y+y*z+x*y+x*z<= n ; z++) {
                    ans+= valid(x,y,z,n);
                }
            }
        }
        return ans;
    }
    public static void main(String args[]){
        Scanner scan = new Scanner(System.in);
        int n;
        n = scan.nextInt();
        for (int i = 1; i <= n ; i++) {
            System.out.println(solve(i));
        }
    }
}


#include<stdio.h>

int main()
{
	int a,b,c;
	scanf("%d %d %d",&a,&b,&c);
	int ctr=0;
	for(int i=a;i<=b;i++)
	{
		if(i%c==0)
		{
			ctr++;
		}
	}
	printf("%d\n",ctr);
	return 0;
}


#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <stdio.h>
#include <time.h>
#include <numeric>
#include <random>
#include <unordered_map>
#include <unordered_set>
#define all(a) a.begin(),a.end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define pb push_back
#define debug(x) cerr << #x << ':' << x << '\n'
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;
typedef complex<ld> com;
constexpr int inf = 1000000010;
constexpr ll INF = 1000000000000000010;
constexpr ld eps = 1e-12;
constexpr ld pi = 3.141592653589793238;
template<class T, class U> inline bool chmax(T &a, const U &b) { if (a < b) { a = b; return true; } return false; }
template<class T, class U> inline bool chmin(T &a, const U &b) { if (a > b) { a = b; return true; } return false; }

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(20);

	int l, r, d;
	cin >> l >> r >> d;
	cout << r / d - (l - 1) / d << '\n';
}


#include <bits/stdc++.h>
#define rep(i, start, end) for (long long i = start; i < end; ++i)
#define repreverse(i, start, end) for (long long i = start; i >= end; --i)
#define all(x) (x).begin(), (x).end()
#define len(x) ((long long)(x).size())
#define lcm(a, b) ((a) / __gcd((a), (b)) * (b))
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vllvll = vector<vll>;
using pll = pair<ll, ll>;
template<class T>void print1d(T x,ll n=-1){if(n==-1)n=x.size();rep(i,0,n){cout<<x[i]<<' ';}cout<<'\n';}
template<class T>void print2d(T x,ll r=-1,ll c=-1){if(r==-1)r=x.size();if(c==-1)c=x[0].size();rep(i,0,r)print1d(x[i],c);}
template<class T, class U>bool haskey(T mp, U key) { return mp.find(key) != mp.end(); }
template<class T, class U>bool isin(T el, U container) { return find(all(container), el) != container.end(); }
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
template<class T>bool even(T n) { return ! (n & 1); }
template<class T>bool odd(T n) { return n & 1; }
template<class T>ld deg2rad(T deg) { return M_PI * deg / 180.0; }
template<class T>ld rad2deg(T rad) { return 180.0 * rad / M_PI; }
ll intpow(ll a,ll n){ll p=1;while(n){if(n&1)p*=a;a*=a;n>>=1;}return p;}
const long double pi = M_PI;
const long long big = 1LL << 50;
const long long inf = 1LL << 60;
const long long mod = 1e9 + 7;

int main()
{
        ll L, R, d;
        cin >> L >> R >> d;
        cout << (R/d) - (L-1)/d << endl;
}


#include <iostream>
using namespace std;

int main(){
	int L, R, d, mul=0;
	cin>>L>>R>>d;
	if(L!=d){
		mul= R/d - L/d;
		cout<<mul<<endl;
	}
	else{
	mul = R/d;
	cout<<mul<<endl;
	}

}


#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using namespace std;
using ll = long long;
using Edge = int;
using Graph = vector<vector<Edge>>;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
const ll MOD = 1000000007;
const ll nmax = 8;
const ll INF = 1e13;
const int MAX = 510000;
bool graph[nmax][nmax];
long long fac[MAX], finv[MAX], inv[MAX];

void COMinit()
{
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++)
    {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

ll COM(int n, int k)
{
    if (n < k)
        return 0;
    if (n < 0 || k < 0)
        return 0;

    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

vector<vector<ll>> dist = vector<vector<ll>>(nmax, vector<ll>(nmax, INF));
struct SegmentTree
{
private:
    ll n;
    vector<ll> node;

public:
    SegmentTree(vector<ll> v)
    {
        ll sz = v.size();
        n = 1;
        while (n < sz)
        {
            n *= 2;
        }
        node.resize(2 * n - 1, INF);

        for (ll i = 0; i < sz; i++)
        {
            node[i + n - 1] = v[i];
        }

        for (ll i = n - 2; i >= 0; i--)
        {
            node[i] = min(node[2 * i + 1], node[2 * i + 2]);
        }
    }
    void update(ll x, ll val)
    {
        x += (n - 1);
        node[x] = val;
        while (x > 0)
        {
            x = (x - 1) / 2;
            node[x] = min(node[2 * x + 1], node[2 * x + 2]);
        }
    }

    // findは半開区間で考える
    ll find(ll a, ll b, ll k = 0, ll l = 0, ll r = -1)
    {
        if (r < 0)
            r = n;

        if (r <= a || b <= l)
            return INF;

        if (a <= l && r <= b)
            return node[k];

        ll vl = find(a, b, 2 * k + 1, l, (l + r) / 2);
        ll vr = find(a, b, 2 * k + 2, (l + r) / 2, r);
        return min(vl, vr);
    }
};
void warshall_floyd(ll n)
{
    for (size_t i = 0; i < n; i++)
    {
        for (size_t j = 0; j < n; j++)
        {
            for (size_t k = 0; k < n; k++)
            {
                dist[j][k] = min(dist[j][k], dist[j][i] + dist[i][k]);
            }
        }
    }
}

class UnionFind
{
public:
    vector<ll> Parent;

    UnionFind(ll N)
    {
        Parent = vector<ll>(N, -1);
    }
    ll find(ll A)
    {
        if (Parent[A] < 0)
            return A;
        return Parent[A] = find(Parent[A]);
    }

    ll size(ll A)
    {
        return -Parent[find(A)];
    }

    bool Union(ll A, ll B)
    {
        A = find(A);
        B = find(B);
        if (A == B)
        {
            return false;
        }
        if (size(A) < size(B))
            swap(A, B);

        Parent[A] += Parent[B];
        Parent[B] = A;

        return true;
    }
};

ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}

ll lcm(ll a, ll b)
{
    ll g = gcd(a, b);
    return a / g * b;
}

ll mulMod(ll a, ll b)
{
    return (((a % MOD) * (b % MOD)) % MOD);
}

ll powMod(ll a, ll p)
{
    if (p == 0)
    {
        return 1;
    }
    else if (p % 2 == 0)
    {
        ll half = powMod(a, p / 2);
        return mulMod(half, half);
    }
    else
    {
        return mulMod(powMod(a, p - 1), a);
    }
}

ll ceil(ll a, ll b)
{
    return (a + b - 1) / b;
}

vector<ll> tsort(Graph G)
{
    ll N = G.size();
    vector<ll> in(N);
    for (auto &&edges : G)
    {
        for (auto &&edge : edges)
        {
            in[edge]++;
        }
    }

    queue<int> que;

    for (int i = 0; i < N; i++)
    {
        if (in[i] == 0)
        {
            que.push(i);
        }
    }
    int cnt = 0;
    vector<ll> ans;
    while (!que.empty())
    {
        int v = que.front();
        que.pop();
        ans.push_back(v);
        for (auto &&next : G[v])
        {

            in[next]--;
            if (in[next] == 0)
            {
                que.push(next);
            }
        }
    }
    return ans;
}

void solve(long long L, long long R, long long d){
    ll ans = 0;
    for (int i = L; i <= R; i++)
    {
        if(i % d == 0)ans++;
    }
    cout << ans << endl;

}

int main(){
    long long L;
    scanf("%lld",&L);
    long long R;
    scanf("%lld",&R);
    long long d;
    scanf("%lld",&d);
    solve(L, R, d);
    return 0;
}


/*==========================================================================*/
/*
    AUTHOR:    BPZ
	CREATED:   10.09.2020 18:04:20

*/
/*--------------------------------------------------------------------------*/
#include<bits/stdc++.h>
using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  const int maxn = (int)1e7 + 6;
  vector<int> ans(maxn, 0);
 	for (int i = 1; i <= 1000; i++) {
 		for (int j = 1; j <= 1000; j++) {
 			for (int k = 1; k <= 1000; k++) {
 				int pos = pow(i + j + k, 2) - i * j - i * k - j * k;
 				ans[pos]++;
 			}
 		}
 	}
 	for (int i = 1; i <= n; i++) {
 		cout << ans[i] << '\n';
 	}
  return 0;
}


#include <stdio.h>
int main(){
    int l, r, d, cont=0;
    scanf("%d %d %d", &l, &r, &d);
    for(int i = l; i <= r; ++i){
        if(i%d==0)
            cont++;
    }
    printf("%d\n", cont);

    return 0;
}


int L,R,d,cnt=0;
main()
{
  scanf("%d%d%d",&L,&R,&d);
  for(int i=L;i<=R;i++)if(i%d==0)cnt++;
  printf("%d\n",cnt);
}


#include<stdio.h>
int main()
{
  int i,l,r,d,count=0;
  scanf("%d %d %d",&l,&r,&d);
  for(i=l;i<=r;i++)
  {
    if(i % d == 0)
    {
      count++;
    }
  }
  printf("%d",count);
}


#include<stdio.h>
int sum(int a,int b,int c){
 if(a>=b&&a>=c)
   return a;
  else if(b>=a&&b>=c)
    return b;
  else
    return c;
}

int main(){
  int a,b,c;
  scanf("%d%d%d",&a,&b,&c);
  printf("%d",sum(a,b,c));
  return 0;
}


#include<stdio.h>
int sum(int a,int b,int c){
 if(a>=b&&a>=c)
   return a;
  else if(b>=a&&b>=c)
    return b;
  else
    return c;
}

int main(){
  int a,b,c;
  scanf("%d",&a,&b,&c);
  printf("%d",sum(a,b,c));
  return 0;
}


#include <stdio.h>
#include <string.h>
int main(void){
  int l,r,n,d;
  n=0;
  scanf("%d %d %d",&l,&r,&d);
  for(int i=0;i<r-l+1;i++){
    if((l+i)%d==0){
      n++;
    }
  }
  printf("%d",&n);
  return 0;
}


function Main(input) {
  let lines = input.split("\n");
  lines.pop();
  lines = lines[0].split(" ");
  fnum = parseInt(lines[0]);
  lnum = parseInt(lines[1]);
  multiple = parseInt(lines[2]);
  let count = 0;
  for(let i = fnum; i <= lnum; i++){
  	if(i%multiple === 0) count++;
  }
  console.log(count);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


//let input = "6 20 7";

function main(input){
  input = input.trim();
  let list = input.split(" ");
  let min = parseInt(list[0])-1;
  let max = parseInt(list[1]);
  let a = parseInt(list[2]);
  let dai = Math.floor(max/a);
  let syou = Math.floor(min/a);
  let answer = dai - syou;
  console.log(answer);
}
//main(input);
main(require("fs").readFileSync("/dev/stdin", "utf8"));


"use strict";

const main = arg => {
    arg = arg.trim().split("\n");
    const L = parseInt(arg[0].split(" ")[0]);
    const R = parseInt(arg[0].split(" ")[1]);
    const d = parseInt(arg[0].split(" ")[2]);

    let answer = 0;

    for(let i=L; i<=R; i++) {
        if(i % d === 0) answer++;
    }

    console.log(answer);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


//let input = "6 20 7";

function main(input){
  input = input.trim();
  let list = input.split(" ");
  let min = parseInt(list[0]);
  let max = parseInt(list[1]);
  let a = parseInt(list[2]);
  let dai = Math.floor(max/a);
  let syou = Math.floor(min/a);
  let answer = dai - syou;
  console.log(answer);
}
//main(input);
main(require("fs").readFileSync("/dev/stdin", "utf8"));


//let input = "6 20 7";

function main(input){
  input = input.trim();
  let list = input.split(" ");
  let min = parseInt(list[0]);
  let max = parseInt(list[1]);
  let a = parseInt(list[2]);
  let dai = Math.floor(max/a);
  let syou = Math.floor(min/a);
  let answer = dai - syou;
  console.log(answer);
}
//main(input);
function main(input){ } main(require("fs").readFileSync("/dev/stdin", "utf8"));


function main(input){
  input = input.trim();
  let list = input.split(" ");
  let min = parseInt(list[0]);
  let max = parseInt(list[1]);
  let a = parseInt(list[2]);
  let dai = Math.floor(max/a);
  let syou = Math.floor(min/a);
  let answer = dai - syou;
  console.log(answer);
}
function main(input){ } main(require("fs").readFileSync("/dev/stdin", "utf8"));


package main

import "fmt"

func main() {
  var l,r,d int
  fmt.Scan(&l,&r,&d)
  answer := (r/d - (l-1) / d)
  if (l==r && r==d) {
      fmt.Println(1)
  } else {
    fmt.Println(answer)
  }
}


package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"reflect"
	"sort"
	"strconv"
	"strings"
	// "regexp"
)

/* sort */
type pair struct {
	index  int64
	p1, p2 interface{}
}
type pairs []pair

func (slice pairs) Len() int {
	return len(slice)
}

func (slice pairs) Less(i, j int) bool {
	return slice[i].index < slice[j].index
}

func (slice pairs) Swap(i, j int) {
	slice[i], slice[j] = slice[j], slice[i]
}

/* sort */
type Int64Slice []int64

func (slice Int64Slice) Len() int {
	return len(slice)
}

func (slice Int64Slice) Less(i, j int) bool {
	return slice[i] < slice[j]
}

func (slice Int64Slice) Swap(i, j int) {
	slice[i], slice[j] = slice[j], slice[i]
}
func Int64s(a []int64)                    { sort.Sort(Int64Slice(a)) }
func Int64sSliceAreSorted(a []int64) bool { return sort.IsSorted(Int64Slice(a)) }

const (
	initialBufSize = 1e4
	maxBufSize     = 1e8
	INF            = 1e8
)

var (
	scanner = bufio.NewScanner(os.Stdin)
	writer  = bufio.NewWriter(os.Stdout)
	di      = []int64{-1, 0, 1, 0}
	dj      = []int64{0, -1, 0, 1}
	di8     = []int64{-1, -1, 0, 1, 1, 1, 0, -1}
	dj8     = []int64{0, -1, -1, -1, 0, 1, 1, 1}
)

func main() {
	buf := make([]byte, initialBufSize)
	scanner.Buffer(buf, maxBufSize)
	scanner.Split(bufio.ScanWords)
	L, R, d := readInt(), readInt(), readInt()
	var ans int64
	for i := L; i <= R; i++ {
		if i%d == 0 {
			ans++
		}
	}
	fmt.Println(ans)
}

/*==========================================
 *             Library
 *==========================================*/
func NextPermutation(x sort.Interface) bool {
	n := x.Len() - 1
	if n < 1 {
		return false
	}
	j := n - 1
	for ; !x.Less(j, j+1); j-- {
		if j == 0 {
			return false
		}
	}
	l := n
	for !x.Less(j, l) {
		l--
	}
	x.Swap(j, l)
	for k, l := j+1, n; k < l; {
		x.Swap(k, l)
		k++
		l--
	}
	return true
}
func doubleAry(h int64, w int64, init int64) (res [][]int64) {
	res = make([][]int64, h)
	for i := int64(0); i < h; i++ {
		res[i] = make([]int64, w)
		for j := int64(0); j < w; j++ {
			res[i][j] = init
		}
	}
	return
}

func aryEq(a []int64, b []int64) bool {
	return reflect.DeepEqual(a, b)
}

func clone(n []int64) (r []int64) {
	r = make([]int64, len(n))
	for i := 0; i < len(n); i++ {
		r[i] = n[i]
	}
	return
}
func write(s string) {
	writer.WriteString(s)
}

func print() {
	writer.Flush()
}

// scanner.Split(bufio.ScanWords) をコメントアウトしないと使用不可
func readLine() (s string) {
	if scanner.Scan() {
		s = scanner.Text()
	}
	return s
}

func readInt() (read int64) {
	scanner.Scan()
	read, err := strconv.ParseInt(scanner.Text(), 10, 64)
	if err != nil {
		panic(err)
	}
	return
}

func readFloat() (read float64) {
	scanner.Scan()
	read, err := strconv.ParseFloat(scanner.Text(), 64)
	if err != nil {
		panic(err)
	}
	return
}

func readRunes() (read []rune) {
	scanner.Scan()
	for _, v := range scanner.Text() {
		read = append(read, v)
	}
	return
}

func readString() (read string) {
	scanner.Scan()
	read = scanner.Text()
	return
}

func readStrings() (read []string) {
	scanner.Scan()
	for _, v := range scanner.Text() {
		read = append(read, string(v))
	}
	return
}

func s2i(s string) int64 {
	var intVal, e = strconv.ParseInt(s, 10, 64)
	if e != nil {
		panic(e)
	}
	return intVal
}

func i2s(i int64) string {
	var strVal = strconv.FormatInt(i, 10)
	return strVal
}

func s2f(s string) float64 {
	var floatVal, e = strconv.ParseFloat(s, 64)
	if e != nil {
		panic(e)
	}
	return floatVal
}

func abs(i int64) int64 {
	return int64(math.Abs(float64(i)))
}

func max(a ...int64) int64 {
	ans := int64(0)
	for i, v := range a {
		if i == 0 {
			ans = v
		}
		if ans < v {
			ans = v
		}
	}
	return ans
}
func min(a ...int64) int64 {
	ans := int64(0)
	for i, v := range a {
		if i == 0 {
			ans = v
		}
		if ans > v {
			ans = v
		}
	}
	return ans
}

func sum(i []int64) int64 {
	sum := int64(0)
	for _, val := range i {
		sum += val
	}
	return sum
}

func split(s string) []string {
	return strings.Fields(s)
}

func strAry2intAry(strs []string) []int64 {
	var ret = make([]int64, 0, len(strs))
	for _, str := range strs {
		var intVal = s2i(str)
		ret = append(ret, intVal)
	}
	return ret
}

func intAry2strAry(nums []int64) []string {
	var ret = make([]string, 0, len(nums))
	for _, num := range nums {
		var strVal = i2s(num)
		ret = append(ret, strVal)
	}
	return ret
}

func ary2str(strs []string) string {
	return strings.Join(strs, " ")
}

func reverse(res []int64) []int64 {
	for i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {
		res[i], res[j] = res[j], res[i]
	}
	return res
}
func reverseStr(res []string) []string {
	for i, j := 0, len(res)-1; i < j; i, j = i+1, j-1 {
		res[i], res[j] = res[j], res[i]
	}
	return res
}

func ini(res []int, init int) {
	if len(res) == 0 {
		return
	}
	res[0] = init
	for i := 0; i < len(res); i++ {
		copy(res[i:], res[:i])
	}
}

//
// func regexpExample() {
//     // Your code here!
//     var str = "13:20"
//     r := regexp.MustCompile(`(\d+):(\d+)`)
//     fmt.Println(r.FindStringSubmatch(str))
// }

// type Country struct {
//     gold int
//     silver int
//     blonze int
// }

// // 複数ソートのサンプル
// func stableSortExample() []Country{
//     var country = []Country {
//         {gold:1, silver:2, blonze:3},
//         {gold:1, silver:2, blonze:3},
//         {gold:1, silver:3, blonze:2},
//         {gold:1, silver:3, blonze:3},
//     }
//     sort.SliceStable(country, func(i, j int) bool { return country[i].blonze > country[j].blonze })
//     sort.SliceStable(country, func(i, j int) bool { return country[i].silver > country[j].silver })
//     sort.SliceStable(country, func(i, j int) bool { return country[i].gold > country[j].gold })
//     return country
// }


package main

import "fmt"

func main() {
	a, b, c := 0, 0, 0
	fmt.Scanf("%d %d %d", &a, &b, &c)
	fmt.Println(b/c-(a-1)/c)
}


package main

import "fmt"

func main() {
  var l,r,d int
  fmt.Scan(&l,&r,&d)
  var c int
  for {
    if l > r {
      break
    } else if (l / d) == 0 {
      c++
    }
    l++
  }
  fmt.Println(c)
}
package main

import "fmt"

func main() {
  var l,r,d int
  fmt.Scan(&l,&r,&d)
  var c int
  for {
    if l > r {
      break
    } else if (l % d) == 0 {
      c++
    }
    l++
  }
  fmt.Println(c)
}


package main

import "fmt"

func main() {
  var l,r,d int
  fmt.Scan(&l,&r,&d)
  var c int
  for {
    if l > r {
      break
    } else if (l / d) == 0 {
      c++
    }
    l++
  }
  fmt.Println(c)
}


package main

import "fmt"

func main() {
  var l,r,d int
  fmt.Scan(&l,&r,&d)
  answer := (r-l+1) / d
  if (l==r && r==d) {
      fmt.Println(1)
  } else {
    fmt.Println(answer)
  }
}


L, R, d = gets.split.map(&:to_i)
count = 0

(L..R).each do |i|
  count += 1 if i % d == 0
end

puts count


l, r, d = gets.split.map(&:to_i)

puts r / d - (l - 1) / d


L,R,d = gets.chomp.split.map(&:to_i)
cnt = 0

(L..R).each do |num|
    if num % d == 0
        cnt += 1
    end
end

puts cnt


L, R, d = gets.split.map(&:to_i)

puts d==1 ? R/d - L/d + 1 :  R/d - L/d


L,R,d = gets.chomp.split.map(&:to_i)

puts R/d-L/d


n = gets.to_i

res = []
(1..Math.sqrt(n).to_i).each do |x|
  (1..Math.sqrt(n).to_i).each do |y|
    (1..Math.sqrt(n).to_i).each do |z|
      cal = (x**x) + (y**y) + (z**z) + (x * y) + (y * z) + (z * x)
      res << cal
    end
  end
end
n_res = res.select { |r| r <= n }

(1..n).each do |i|
  puts n_res.count(i)
end


use whiteread::parse_line;

fn main() {
    let (l, r, d): (u64, u64, u64) = parse_line().unwrap();
    println!("{}", (l..=r).filter(|x| x % d == 0).count());
}


fn input_vec<T: std::str::FromStr>()->Vec<T>{
	let mut s = String::new();
	std::io::stdin().read_line(&mut s).ok();
	s.trim().split_whitespace().map(|e| e.parse().ok().unwrap()).collect()
}
fn main() {
	let input = input_vec::<i64>();
	let l = input[0];
	let r = input[1];
	let d = input[2];
	let result = (r-r%d)/d-(l-1-(l-1)%d)/d;
	println!("{}",result);

}


use proconio::input;
#[allow(unused_imports)]
use proconio::marker::{Bytes, Chars};
#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
	input! {
		l: usize,
		r: usize,
		d: usize,
	}

	let mut count = 0;
	for i in l..=r {
		if i % d == 0 {
			count += 1;
		}
	}

	println!("{}", count);
}


sed_imports)]
#![allow(dead_code)]

use proconio::input;
use proconio::marker::{Bytes, Chars};
use std::collections::*;

fn main() {
    input! {l:i32,r:i32,d:i32}
    let ans = r / d - (l - 1) / d;
    println!("{}", ans);
}


use std::io;

fn main() {
    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    let mut n = buf.split(' ');
    let mut n = || n.next().unwrap().parse().unwrap();
    let l: i32 = n();
    let r: i32 = n();
    let d: i32 = n();
    println!("{}", (l..=r).filter(|x| x % d == 0).count());
}


let (l, r, d) = readInts().mapToTuple()
print((l...r).filter { $0.isMultiple(of: d) }.count)

// MARK: -----------------------------------------------------------------------

func readInt() -> Int {
    Int(readLine()!)!
}

func readInts() -> [Int] {
    readLine()!.split(separator: " ").map { Int($0)! }
}

extension Collection {
    func mapToTuple() -> (Element, Element) {
        var i = makeIterator()
        return (i.next()!, i.next()!)
    }
    func mapToTuple() -> (Element, Element, Element) {
        var i = makeIterator()
        return (i.next()!, i.next()!, i.next()!)
    }
    func mapToTuple() -> (Element, Element, Element, Element) {
        var i = makeIterator()
        return (i.next()!, i.next()!, i.next()!, i.next()!)
    }

    func safe(at index: Index) -> Element? {
        self.indices.contains(index) ? self[index] : nil
    }
}

struct DP<Argument: Hashable, Element> {
    var dictionary = [Argument: Element]()

    var expression: (Argument, (Argument) -> Element) -> Element

    init(expression: @escaping (_ argument: Argument, _ note: (Argument) -> Element) -> Element) {
        self.expression = expression
    }

    subscript(_ argument: Argument) -> Element {
        mutating _read {
            if let note = dictionary[argument] {
                yield note
            } else {
                let result = expression(argument) { self[$0] }
                dictionary[argument] = result
                yield result
            }
        }
    }
}


let input = readLine()!.split(separator: " ").map { Int($0)! }

let L = input[0]
let R = input[1]
let d = input[2]

var count = 0
for v in L...R {
  if v % d == 0 {
    count += 1
  }
}
print(count)


protocol InitFromString {
    init?(_ str: String)
}

extension Int: InitFromString {}
extension Int8: InitFromString {}
extension Int16: InitFromString {}
extension Int32: InitFromString {}
extension Int64: InitFromString {}
extension String: InitFromString {}

func input<T: InitFromString>() -> [T] {
    readLine()!.split(separator: " ").map(String.init).compactMap(T.init)
}

let inputLine: [Int] = input()
let count = (inputLine[0]...inputLine[1]).reduce(into: 0) { (result, i) in
    if i % inputLine[2] == 0 {
        result += 1
    }
}

print(count)


var a = [[1,2]]
a + [[1]]

func totalUreshisa (rakudaList: [Int], uresiList: [[Int]]) -> Int {
    var total = 0
    for i in 1...rakudaList.count {
        if rakudaList[i-1] <= uresiList[i-1][0] {
            total += uresiList[i-1][1]
        } else {
            total += uresiList[i-1][2]
        }
    }
    return total
}

func allArrayOfRakuda (rakudaNum: Int) -> [[Int]] {
    let rakudaLeft = Array(1...rakudaNum)
    func recursiveF (rakudaLeft: [Int], rakudaList: [Int]) -> [[Int]] {
        var new = [[Int]]()
        if rakudaLeft.count == 0 {
            return [rakudaList]
        }
        for i in 1...rakudaLeft.count {
            var chooseList = rakudaLeft
            let chozen = chooseList.remove(at: i-1)
            new += recursiveF(rakudaLeft: chooseList, rakudaList: rakudaList + [chozen])
        }
        return new
    }
    return recursiveF(rakudaLeft: rakudaLeft, rakudaList: [])
}

func main() {
    let t = Int(readLine()!)!
    for _ in 1...t {
        let n = Int(readLine()!)!
        var uresisa = [[Int]]()
        for _ in 1...n {
            uresisa.append(readLine()!.split(separator: " ").map{Int($0)!})
        }
        var maxUresisa = 0
        for item in allArrayOfRakuda(rakudaNum: n) {
            let aTotalUresisa = totalUreshisa(rakudaList: item, uresiList: uresisa)
            if maxUresisa < aTotalUresisa {
                maxUresisa = aTotalUresisa
            }

        }
        print(maxUresisa)
    }
}

main()


import Foundation

let input_N = Int(readLine()!)!
var counts = [Int](repeating: 0, count: input_N)
// x+y ^2 + y+z ^2 + z+x ^2 = 2n
let min = Int(sqrt(Double(input_N) / 6.0))
let max = Int(sqrt(Double(input_N)))

for it in 1...input_N {
    // x >= y >= z
    for x in min...max {
        for z in 1...min {
            for y in z...x {
                if x*x + y*y + z*z + x*y + y*z + z*x == it {
                    if x == y && y == z {
                        counts[it-1] += 1
                    } else if x == y || y == z {
                        counts[it-1] += 3
                    } else {
                        counts[it-1] += 6
                    }
                }
            }
        }
    }
}

counts.forEach {print($0)}


import Foundation
let N = Int(readLine()!)!

func check (_ n:Int) -> Int {
    var count = 0
    for x in 1 ... Int(sqrt(Double(n)))+1 {
        if x*x >= n {
            break
        }
        for y in 1 ... Int(sqrt(Double(n)))+1 {
            if y*y > n || x*y > n{
                break
            }
            for z in 1 ... Int(sqrt(Double(n)))+1 {
                if z*z > n || y*z > n || z*x > n {
                    break
                }
                if x*x+y*y+z*z+x*y+y*z+z*x == n {
                    count += 1
                }
            }
        }
    }
    return count
}

for i in 1 ... N {
    print(check(i))
}