SP30759 ADACABAA - Ada and Species

Description

As you might know, Ada the Ladybug is a farmer. She needs to choose some species of vegetables. Each vegetable disposes with four important attributes. We say that a vegetable is worst than another vegetable, if all of its four attributes are greater. She wants to eliminate the list of vegetables, so only vegetables, which are not worse than any other vegetables remains.

Input Format

The first line contains integer **1** Each of the next **N** lines contains four integers **1 . It is guaranteed, that all **X** attributes are distinct for all vegetables. The same is true for **Y, Z** and **W** (so in fact, there are four permutations of numbers from **1** to **N**).**

Output Format

Print the number of vegetables, which are not worse than any other vegetable.