#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t = 1;
  while (t--) {
    long long int n, k, l, r, ans = 0, m = 1;
    cin >> n;
    vector<pair<long long int, long long int>> p;
    for (long long int i = 1; i <= n; i++) {
      cin >> l >> r;
      p.push_back(make_pair(l, r));
    }
    cin >> k;
    for (long long int i = 0; i < p.size(); i++) {
      if (k <= p[i].second) {
        ans++;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
