Swords
면접 대비시간 제한1초메모리 제한1024 MB
모든 공격력과 방어력 쌍이 서로 다를 때, 다른 검에게 두 능력치 모두에게 지지 않는 검의 개수를 센다.
문제
Yan Hao has swords numbered from to . Sword has attack and defence .
Yan Hao thinks that sword is useless if there exists a different sword () such that and . That is, a sword is useless if the attack and defence of another sword are both at least as good as that of sword . If a sword is not useless, we say that it is useful.
Two swords are considered equivalent if they have the same attack and same defence. It is guaranteed that no pair of swords are equivalent.
Help Yan Hao find the number of useful swords in his collection.
입력
The first line of input contains exactly integer, .
The next lines of input contains two space-separated integers each. The -th such line of input will contain and respectively, indicating the attack and defence of sword .
출력
The output should contain one integer, the number of useful swords.
제한
- For all , or