Language: C++

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Console;
using static System.Math;

namespace atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            do
            {
                new Program().Solve(new ConsoleInput(In));
            } while (args.Length > 0 && args[0] == "Debug");
        }

        public void Solve(ConsoleInput input)
        {
            int r = input.ReadInt;
            int g = input.ReadInt;
            int b = input.ReadInt;
            double n = input.ReadInt;

            int count = 0;
            for (int ir = 0; ir <= n; ir += r)
            {
                for (int ig = 0; ig + ir <= n; ig += g)
                {
                    for (int ib = 0; ib + ig + ir <= n; ib += b)
                    {
                        if (ir + ig + ib == n)
                        {
                            count++;
                        }
                    }
                }
            }

            WriteLine($"{count}");
        }
    }
}

class Math
{
    public static int Min(params int[] a)
    {
        if (a.Length == 0) return 0;

        var min = a[0];
        for (var i = 1; i < a.Length; i++)
        {
            if (min > a[i]) min = a[i];
        }
        return min;
    }
    public static long Min(params long[] a)
    {
        if (a.Length == 0) return 0;

        var min = a[0];
        for (var i = 1; i < a.Length; i++)
        {
            if (min > a[i]) min = a[i];
        }
        return min;
    }

    public static int Max(params int[] a)
    {
        if (a.Length == 0) return 0;

        var max = a[0];
        for (var i = 1; i < a.Length; i++)
        {
            if (max < a[i]) max = a[i];
        }
        return max;
    }
    public static long Max(params long[] a)
    {
        if (a.Length == 0) return 0;

        var max = a[0];
        for (var i = 1; i < a.Length; i++)
        {
            if (max < a[i]) max = a[i];
        }
        return max;
    }

    public static int Lcm(int a, int b)
    {
        return a * b / Gcd(a, b);
    }

    public static int Gcd(int a, int b)
    {
        if (a < b)
            return Gcd(b, a);
        while (b != 0)
        {
            var remainder = a % b;
            a = b;
            b = remainder;
        }
        return a;
    }
}

class UnionFind
{
    private int[] parent;
    private int[] rank;
    private long[] size;

    public UnionFind(int count)
    {
        parent = new int[count];
        rank = new int[count];
        size = new long[count];
        for (var i = 0; i < count; i++)
        {
            parent[i] = i;
            rank[i] = 0;
            size[i] = 1;
        }
    }

    public int Root(int x)
    {
        if (parent[x] != x)
        {
            parent[x] = Root(parent[x]);
        }
        return parent[x];
    }

    public void Unite(int a, int b)
    {
        var ra = Root(a);
        var rb = Root(b);

        if (Size(ra) < Size(rb))
        {
            parent[ra] = rb;
            size[rb] += size[ra];
        }
        else
        {
            parent[rb] = ra;
            size[ra] += size[rb];
        }
        if (rank[ra] == rank[rb]) rank[ra]++;
    }

    public bool Same(int a, int b)
    {
        return Root(a) == Root(b);
    }

    public long Size(int x)
    {
        return size[Root(x)];
    }
}

class ConsoleInput
{
    private readonly System.IO.TextReader _stream;
    private readonly char _separator;
    private Queue<string> inputStream;
    public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
    {
        _separator = separator;
        _stream = stream;
        inputStream = new Queue<string>();
    }
    public string Read
    {
        get
        {
            if (inputStream.Count != 0) return inputStream.Dequeue();
            string[] tmp = _stream.ReadLine().Split(_separator);
            for (int i = 0; i < tmp.Length; ++i)
                inputStream.Enqueue(tmp[i]);
            return inputStream.Dequeue();
        }
    }
    public string ReadLine { get { return _stream.ReadLine(); } }
    public int ReadInt { get { return int.Parse(Read); } }
    public long ReadLong { get { return long.Parse(Read); } }
    public double ReadDouble { get { return double.Parse(Read); } }
    public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
    public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
    public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
}


Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:3:7: error: expected nested-name-specifier before 'System'
    3 | using System.Diagnostics;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Linq;
      |       ^~~~~~
a.cc:5:7: error: expected nested-name-specifier before 'System'
    5 | using System.Text;
      |       ^~~~~~
a.cc:6:7: error: expected nested-name-specifier before 'System'
    6 | using System.Threading.Tasks;
      |       ^~~~~~
a.cc:7:7: error: expected nested-name-specifier before 'static'
    7 | using static System.Console;
      |       ^~~~~~
a.cc:8:7: error: expected nested-name-specifier before 'static'
    8 | using static System.Math;
      |       ^~~~~~
a.cc:14:26: error: 'string' has not been declared
   14 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:14:35: error: expected ',' or '...' before 'args'
   14 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:22:15: error: expected ':' before 'void'
   22 |         public void Solve(ConsoleInput input)
      |               ^~~~~
      |               :
a.cc:22:27: error: 'ConsoleInput' has not been declared
   22 |         public void Solve(ConsoleInput input)
      |                           ^~~~~~~~~~~~
a.cc:46:6: error: expected ';' after class definition
   46 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void atcoder::Program::Main(int*)':
a.cc:18:30: error: expected ';' before '.' token
   18 |                 new Program().Solve(new ConsoleInput(In));
      |                              ^
a.cc:19:22: error: 'args' was not declared in this scope
   19 |             } while (args.Length > 0 && args[0] == "Debug");
      |                      ^~~~
a.cc: In member function 'void atcoder::Program::Solve(int)':
a.cc:24:27: error: request for member 'ReadInt' in 'input', which is of non-class type 'int'
   24 |             int r = input.ReadInt;
      |                           ^~~~~~~
a.cc:25:27: error: request for member 'ReadInt' in 'input', which is of non-class type 'int'
   25 |             int g = input.ReadInt;
      |                           ^~~~~~~
a.cc:26:27: error: request for member 'ReadInt' in 'input', which is of non-class type 'int'
   26 |             int b = input.ReadInt;
      |                           ^~~~~~~
a.cc:27:30: error: request for member 'ReadInt' in 'input', which is of non-class type 'int'
   27 |             double n = input.ReadInt;
      |                              ^~~~~~~
a.cc:44:23: error: '$' was not declared in this scope
   44 |             WriteLine($"{count}");
      |                       ^
a.cc:44:13: error: 'WriteLine' was not declared in this scope
   44 |             WriteLine($"{count}");
      |             ^~~~~~~~~
a.cc: At global scope:
a.cc:51:11: error: expected ':' before 'static'
   51 |     public static int Min(params int[] a)
      |           ^~~~~~~
      |           :
a.cc:51:27: error: 'params' has not been declared
   51 |     public static int Min(params int[] a)
      |                           ^~~~~~
a.cc:51:27: error: two or more data types in declaration of 'parameter'
a.cc:51:39: error: expected ')' before 'a'
   51 |     public static int Min(params int[] a)
      |                          ~            ^~
      |                                       )
a.cc:51:38: error: expected ';' at end of member declaration
   51 |     public static int Min(params int[] a)
      |                                      ^
      |                                       ;
a.cc:51:40: error: 'a' does not name a type
   51 |     public static int Min(params int[] a)
      |                                        ^
a.cc:62:11: error: expected ':' before 'static'
   62 |     public static long Min(params long[] a)
      |           ^~~~~~~
      |           :
a.cc:62:28: error: 'params' has not been declared
   62 |     public static long Min(params long[] a)
      |                            ^~~~~~
a.cc:62:42: error: expected ',' or '...' before 'a'
   62 |     public static long Min(params long[] a)
      |                                          ^
a.cc:74:11: error: expected ':' before 'static'
   74 |     public static int Max(params int[] a)
      |           ^~~~~~~
      |           :
a.cc:74:27: error: 'params' has not been declared
   74 |     public static int Max(params int[] a)
      |                           ^~~~~~
a.cc:74:27: error: two or more data types in declaration of 'parameter'
a.cc:74:39: error: expected ')' before 'a'
   74 |     public static int Max(params int[] a)
      |                          ~            ^~
      |                                       )
a.cc:74:38: error: expected ';' at end of member declaration
   74 |     public static int Max(params int[] a)
      |                                      ^
      |                                       ;
a.cc:74:40: error: 'a' does not name a type
   74 |     public static int Max(params int[] a)
      |                                        ^
a.cc:85:11: error: expected ':' before 'static'
   85 |     public static long Max(params long[] a)
      |           ^~~~~~~
      |           :
a.cc:85:28: error: 'params' has not been declared
   85 |     public static long Max(params long[] a)
      |                            ^~~~~~
a.cc:85:42: error: expected ',' or '...' before 'a'
   85 |     public static long Max(params long[] a)
      |                                          ^
a.cc:97:11: error: expected ':' before 'static'
   97 |     public static int Lcm(int a, int b)
      |           ^~~~~~~
      |           :
a.cc:102:11: error: expected ':' before 'static'
  102 |     public static int Gcd(int a, int b)
      |           ^~~~~~~
      |           :
a.cc:114:2: error: expected ';' after class definition
  114 | }
      |  ^
      |  ;
a.cc: In static member function 'static long int Math::Min(long int*)':
a.cc:64:13: error: 'a' was not declared in this scope
   64 |         if (a.Length == 0) return 0;
      |             ^
a.cc:66:9: error: 'var' was not declared in this scope
   66 |         var min = a[0];
      |         ^~~
a.cc:67:18: error: expected ';' before 'i'
   67 |         for (var i = 1; i < a.Length; i++)
      |                  ^
a.cc:67:25: error: 'i' was not declared in this scope
   67 |         for (var i = 1; i < a.Length; i++)
      |                         ^
a.cc:67:29: error: 'a' was not declared in this scope
   67 |         for (var i = 1; i < a.Length; i++)
      |                             ^
a.cc:69:17: error: 'min' was not declared in this scope; did you mean 'Min'?
   69 |             if (min > a[i]) min = a[i];
      |                 ^~~
      |                 Min
a.cc:71:16: error: 'min' was not declared in this scope; did you mean 'Min'?
   71 |         return min;
      |                ^~~
      |                Min
a.cc: In static member function 'static long int Math::Max(long int*)':
a.cc:87:13: error: 'a' was not declared in this scope
   87 |         if (a.Length == 0) return 0;
      |             ^
a.cc:89:9: error: 'var' was not declared in this scope
   89 |         var max = a[0];
      |         ^~~
a.cc:90:18: error: expected ';' before 'i'
   90 |         for (var i = 1; i < a.Length; i++)
      |                  ^
a.cc:90:25: error: 'i' was not declared in this scope
   90 |         for (var i = 1; i < a.Length; i++)
      |                         ^
a.cc:90:29: error: 'a' was not declared in this scope
   90 |         for (var i = 1; i < a.Length; i++)
      |                             ^
a.cc:92:17: error: 'max' was not declared in this scope; did you mean 'Max'?
   92 |             if (max < a[i]) max = a[i];
      |                 ^~~
      |                 Max
a.cc:94:16: error: 'max' was not declared in this scope; did you mean 'Max'?
   94 |         return max;
      |                ^~~
      |                Max
a.cc: In static member function 'static int Math::Gcd(int, int)':
a.cc:108:13: error: 'var' was not declared in this scope
  108 |             var remainder = a % b;
      |             ^~~
a.cc:110:17: error: 'remainder' was not declared in this scope
  110 |             b = remainder;
      |                 ^~~~~~~~~
a.cc: At global scope:
a.cc:118:12: error: expected ':' before 'int'
  118 |     private int[] parent;
      |            ^~~~
      |            :
a.cc:118:16: error: expected unqualified-id before '[' token
  118 |     private int[] parent;
      |                ^
a.cc:119:12: error: expected ':' before 'int'
  119 |     private int[] rank;
      |            ^~~~
      |            :
a.cc:119:16: error: expected unqualified-id before '[' token
  119 |     private int[] rank;
      |                ^
a.cc:120:12: error: expected ':' before 'long'
  120 |     private long[] size;
      |            ^~~~~
      |            :
a.cc:120:17: error: expected unqualified-id before '[' token
  120 |     private long[] size;
      |                 ^
a.cc:122:11: error: expected ':' before 'UnionFind'
  122 |     public UnionFind(int count)
      |           ^~~~~~~~~~
      |           :
a.cc:135:11: error: expected ':' before 'int'
  135 |     public int Root(int x)
      |           ^~~~
      |           :
a.cc:144:11: error: expected ':' before 'void'
  144 |     public void Unite(int a, int b)
      |           ^~~~~
      |           :
a.cc:162:11: error: expected ':' before 'bool'
  162 |     public bool Same(int a, int b)
      |           ^~~~~
      |           :
a.cc:167:11: error: expected ':' before 'long'
  167 |     public long Size(int x)
      |           ^~~~~
      |           :
a.cc:171:2: error: expected ';' after class definition
  171 | }
      |  ^
      |  ;
a.cc: In constructor 'UnionFind::UnionFind(int)':
a.cc:124:9: error: 'parent' was not declared in this scope
  124 |         parent = new int[count];
      |         ^~~~~~
a.cc:125: