#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, c;
  cin >> t;
  int a[t], b[t];
  for (int i = 1; i <= t; i++) {
    cin >> a[i] >> b[i];
  }
  cin >> c;
  int cnt;
  for (int i = 1; i <= t; i++) {
    for (int j = a[i]; j <= b[i]; j++) {
      if (c == j) {
        cnt = i;
        break;
      }
    }
  }
  int v = 0;
  for (int i = cnt; i <= t; i++) {
    v++;
  }
  cout << v << endl;
  return 0;
}
