#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> v1;
  vector<int> v2;
  for (int i = 1; i <= n; i++) {
    int a;
    cin >> a;
    int b;
    cin >> b;
    v1.push_back(a);
    v2.push_back(b);
  }
  int metka;
  cin >> metka;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (metka <= v2[i]) cnt++;
  }
  cout << cnt;
  return 0;
}
