#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> l(n), r(n);
  for (int i = 0; i < n; i++) cin >> l[i] >> r[i];
  int k;
  cin >> k;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    cnt += k <= r[i];
  }
  cout << cnt << endl;
  return 0;
}
