#include <bits/stdc++.h>
using namespace std;
struct debugger {
  static void call(const char* it) {}
  template <typename T, typename... valT>
  static void call(const char* it, T val, valT... rest) {
    string var = "";
    for (; *it && *it != ','; it++)
      if (*it != ' ') var += *it;
    cerr << var << '=' << val << " ";
    call(++it, rest...);
  }
};
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > v;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    v.push_back({a, b});
  }
  int k;
  cin >> k;
  int left = n;
  for (int i = 0; i < n; i++) {
    if (k > v[i].second) left--;
  }
  cout << left << endl;
}
