문제 링크 https://www.acmicpc.net/problem/2246
우선 콘도를 정렬해준 후 최소값의 가격를 담아둔 뒤 비교한다.
그렇게 하면 두번째 for문에서 바다에서 멀리 갈수록 가격은 떨어지는 구조가 되기때문에 문제에서 제시한 값을 찾을 수 있다.
condos = []
for i in range(int(input())):
l, p = map(int, input().split())
condos.append([l, p])
condos.sort()
cost = 10001
result = 0
for i in condos:
temp = i[1]
if temp < cost:
cost = temp
result += 1
print(result)