#define _CRT_SECURE_NO_WARNINGS
#include<cstdio>
#include<algorithm>
using namespace std;
struct zuobiao {
int x;
int y;
}zuo[100];
bool cmp(zuobiao x, zuobiao y) {
if (x.x != y.x) {
return x.x > y.x;
}
else {
return x.y < y.y;
}
}
int main() {
int n;
int last;
int ans;
scanf("%d", &n);
for (int i = 0; i < n; i++) {
scanf("%d%d", &zuo[i].x, &zuo[i].y);
}
sort(zuo, zuo + n, cmp);
last = zuo[0].x;
ans = 1;
for (int j = 1; j < n; j++) {
if (zuo[j].y < last || zuo[j].y == last) {
ans++;
last = zuo[j].x;
}
}
printf("%d", ans);
}
08-18
193
03-15
767
11-04
335
11-04
1539