题目描述
Description
n有n种石块,石块能无限供应。每种石块都是长方体,其中第i种石块的长、宽、高分别为li、wi、hi。石块可以旋转,使得其中两维成为长度和宽度,第三维成为高度。如果要把一个石块放在另一个石块上面,必须保证上面石块的长和宽都分别严格小于下面石块的长和宽。这意味着,即使两块长宽相同的石块也不能堆砌起来。
现在神犇想知道,最多能用上多少块石头呢?
输入描述
Input Description
第一行,N;
以下N行,每行三个数,表示第i种石头的长宽高。
输出描述
Output Description
一个整数,表示最多能用上多少块石头。
样例输入
Sample Input
3
1 1 1
2 2 2
3 3 4
样例输出
Sample Output
3
数据范围及提示
Data Size & Hint
N≤50000,其余数字≤maxlongint。