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