#include <bits/stdc++.h>
using namespace std;
long long pw(long long x, long long y) {
  if (y == 0) return 1;
  long long p = pw(x, y / 2);
  if (y % 2) return x * p * p;
  return p * p;
}
inline long long get_num(char ch) {
  if (ch == '-')
    return 0;
  else if (ch >= 'a' && ch <= 'z') {
    return 1 + (ch - 'a');
  } else if (ch >= 'A' && ch <= 'Z') {
    return 27 + (ch - 'A');
  } else if (ch >= '0' && ch <= '9') {
    return 53 + (ch - '0');
  }
}
inline int GA(long long n, vector<long long>& vec) {
  for (long long i = 0; i < n; ++i) {
    long long x;
    cin >> x;
    vec.push_back(x);
  }
}
inline int GAEG(long long m, vector<long long> vec[]) {
  for (long long i = 0; i < m; ++i) {
    long long x, y;
    cin >> x >> y;
    x--, y--;
    vec[x].push_back(y);
    vec[y].push_back(x);
  }
}
vector<pair<long long, long long> > v;
int main() {
  long long n;
  cin >> n;
  for (long long i = 0; i < n; ++i) {
    long long x, y;
    cin >> x >> y;
    v.push_back(make_pair(x, y));
  }
  long long as = n;
  long long k;
  cin >> k;
  for (long long i = 0; i < n; ++i) {
    if (v[i].first <= k && k <= v[i].second) break;
    as--;
  }
  cout << as << endl;
}
