Suitcase mood
Limits: 2 sec., 256 MiB
This statement was translated automatically from Ukrainian.
Finally, it has happened! Serhii’s team has qualified for the final of the Ukrainian Programming Olympiad for the first time.
Now he is very busy packing his things for the trip to Vinnytsia. From older colleagues, he heard that many prizes are awarded for winning, and in addition, all participants are given sponsor merchandise in unlimited quantities.
So Serhii decided to stock up on containers for the prizes: he took all available suitcases down from the attic. Of course, it turned out that he has fewer hands, so he decided that he would take only one suitcase, but would pack into it as many other suitcases as would fit one inside another. At the same time, he wants each suitcase to directly contain only one other suitcase. It is clear that a suitcase can fit into another only if it has strictly smaller dimensions (for example, the suitcase \((2;1;2)\) will not fit into \((2;2;3)\), but \((2;1;1)\) will fit (suitcases can be rotated if desired and with a little effort)).
Input
The first line specifies a single integer \(n\) — the number of available suitcases.
In the next \(n\) lines, three integers are given: \(x\), \(y\), \(z\) — the dimensions of the suitcases.
Output
In a single line, print a single integer — the maximum number of suitcases Serhii can take with him.
Constraints
\(1 \le n \le 100\),
\(1 \le x, y, z \le 10^6\).
Samples
| Input (stdin) | Output (stdout) |
|---|---|
| 4 1 1 1 2 2 2 3 4 5 4 3 2 | 3 |
| Element Type | Created | Who | Problem | Compiler | Result | Time (sec.) | Memory (MiB) | # | Actions |
|---|