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