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