#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int lft[n], rgt[n], i, a;
  int cont = 0;
  for (i = 0; i < n; i++) {
    cin >> lft[i] >> rgt[i];
  }
  cin >> a;
  for (i = 0; i < n; i++)
    if (a <= rgt[i]) cont++;
  cout << cont << endl;
  return 0;
}
