1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 n = int(input()) arr = [] for i in range(n): tmp = list(map(int, input().split())) arr.append(tmp) arr.sort(key = lambda x: (x[1], x[0])) count = 0 end = 0 for i in range(n): if end