---
# System prepended metadata

title: Easy - 2

---

# Easy - 2

Amelia is reading a book of **N** chapters. Each chapter contains at least 2 pages.

While she is reading **K**th page, her friend asked Amelia, how many chapters she has yet to read including the chapter she is curently reading.

Your task is to help Amelia find the number of chapters she has yet to read.

Given a number **N** representing the number of chapters in a book, **X**, **Y** representing the start and end pages of each chapter, and **K** representing the current reading page, determine the number of chapters Amelia has yet to read.

<!-- Given a book with **N** chapters, **start** and **end** pages for each chapter and the marked page **K** where Amelia starts to read from next time, determine the number of chapters Amelia has yet to read. -->

Note:

- There might be empty pages before and after each chapter in the book.

- The number of chapters yet to read should include the chapter that is currently reading.

  For example, if the total chapters are **5**, current reading chapter is **2**, then the number of chapters yet to read is **4**.


---

#### Input

The first line of input contains an integer **N** representing the number of chapters.

The next `N` lines of input contain two space-separated integers **X** and **Y**, representing the **start** and **end** page of each chapter.

The last line of input contains an integer **K** representing the marked page where Amelia starts to read from next time.

---

#### Output

The output should be a single line containing an integer representing the number of chapters Amelia has yet to read.

---

#### Explanation

For example, if `N = 4`,

The `start` and `end` page of each chapter is,

```
1 4
5 7
9 16
17 25
```

The current reading page is `K = 7`,

Note:

In the given example, there is an empty page (**6**) after chapter **2**.


- The current reading page **7** is in chapter **2**.
- Then, the number of chapters Amelia yet to read is **3**. (Chapter **2**, Chapter **3**, and Chapter **4**)

The output should be **3**.