#C14830. Max Packages Load

    ID: 44523 Type: Default 1000ms 256MiB

Max Packages Load

Max Packages Load

You are given the dimensions of a truck and a list of packages. Each package has its own dimensions. A package can be loaded into the truck if and only if each of its dimensions (width, height, depth) does not exceed the corresponding dimension of the truck.

Your task is to determine the maximum number of packages that can be loaded into the truck based on the above condition. Note that the packages are considered independently; there is no need to optimize the packing order or arrangement.

The condition for a package with dimensions \( (w, h, d) \) to fit in a truck with dimensions \( (W, H, D) \) is given by:

\[ w \leq W, \quad h \leq H, \quad d \leq D \]

If all these conditions hold, then the package fits into the truck.

inputFormat

The first line of the input contains three integers \( truck\_width \), \( truck\_height \), and \( truck\_depth \) representing the dimensions of the truck.

The second line contains an integer \( n \) representing the number of packages.

Each of the following \( n \) lines contains three integers representing the dimensions of a package (width, height, depth).

All integers are separated by spaces.

outputFormat

Output a single integer representing the maximum number of packages that can be loaded into the truck.

## sample
10 10 10
4
1 1 1
2 2 2
5 5 5
8 8 8
4

</p>