G : Ares' Dresses

Progress Bar

时间限制:2 Sec 内存限制:256 MiB

提交


题目描述

Ares likes dresses.

A dress can be described by bust(b),waist(w),and hip(h).

She can wear a dress over another dress only if b2>b1 && w2>w1 && h2>h1.

Now please calculate how many dresses Ares can wear at most.

输入描述

The first line contains an integer n - the number of dresses.
(1<=n<=10000)

Each of the next n lines contains three integer bi,wi,hi - a dress' bust,waist and hip.
(1<=bi,wi,hi<=10^9)

输出描述

One integer - the number of dresses Ares can wear at most.

样例输入

3
1 2 3
2 3 4
3 3 5

样例输出

2

来源

风竹曦