#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > a;
  for (int i = 0; i < n; i++) {
    int l, r;
    cin >> l >> r;
    a.push_back({l, r});
  }
  int k;
  cin >> k;
  sort(a.begin(), a.end());
  int ans = n;
  for (int i = 0; i < n; i++) {
    if (a[i].second < k) {
      ans--;
    }
  }
  cout << ans << "\n";
  return 0;
}
