#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[101][2], c = 0;
  cin >> n;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < 2; j++) cin >> a[i][j];
  int k;
  cin >> k;
  for (int i = 0; i < n; i++)
    if (k > a[i][1]) c++;
  cout << (n - c) << endl;
  return 0;
}
