#include <bits/stdc++.h>
using namespace std;
int a[102][2];
int main() {
  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int n;
  int x;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i][0] >> a[i][1];
  cin >> x;
  int counter = 0;
  int i = 0;
  while (!(x <= a[i][1] && x >= a[i][0]) && i < n) {
    i++;
    counter++;
  }
  cout << n - counter << endl;
  return 0;
}
