Time limit
2s
Memory limit
128 MB
You want to choose condos for a trip. Ideally, a candidate should be inexpensive and close to the beach.
A condo X is a candidate only if it satisfies both conditions below.
Given each condo's distance from the beach and lodging cost, determine how many condos can be candidates.
The first line contains the number of condos N. (1 <= N <= 10000)
Each of the next N lines contains two integers D C, describing one condo. D is its distance from the beach, and C is its lodging cost. (1 <= D, C <= 10000)
No two different condos have both the same D and the same C.
Print the number of condos that can be candidates.