1898 {
1899 unsigned int n;
1900 cin >> n;
1901 auto speeds = map<unsigned int, unsigned int>();
1902 for(unsigned int i = 0; i < n; i++) {
1903 unsigned int pos;
1904 unsigned int speed;
1905 cin >> pos >> speed;
1906 speeds.insert(pair(pos, speed));
1907 }
1908 unsigned int current_min = 1000000000;
1909 unsigned int count = 0;
1910 for(auto i = speeds.rbegin(); i != speeds.rend(); ++i) {
1911 if((*i).second <= current_min) {
1912 current_min = (*i).second;
1913 count++;
1914 }
1915 }
1916 cout << count;
1917 return 0;
1918 }