#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int l[N], r[N];
int main() {
  int n;
  scanf("%d", &n);
  int res = 0;
  for (int i = 1; i <= n; ++i) scanf("%d%d", &l[i], &r[i]);
  int k;
  scanf("%d", &k);
  for (int i = 1; i <= n; ++i)
    if (k > r[i]) ++res;
  printf("%d", n - res);
  return 0;
}
