After lessons Nastya decided to read a book. The book contains $n$ chapters, going one after another, so that one page of the book belongs to exactly one chapter and each chapter contains at least one page.

Yesterday evening Nastya did not manage to finish reading the book, so she marked the page with number $k$ as the first page which was not read (i.e. she read all pages from the $1$-st to the $(k-1)$-th).

The next day Nastya's friend Igor came and asked her, how many chapters remain to be read by Nastya? Nastya is too busy now, so she asks you to compute the number of chapters she has not completely read yet (i.e. the number of chapters she has not started to read or has finished reading somewhere in the middle).


-----Input-----

The first line contains a single integer $n$ ($1 \leq n \leq 100$) — the number of chapters in the book.

There are $n$ lines then. The $i$-th of these lines contains two integers $l_i$, $r_i$ separated by space ($l_1 = 1$, $l_i \leq r_i$) — numbers of the first and the last pages of the $i$-th chapter. It's guaranteed that $l_{i+1} = r_i + 1$ for all $1 \leq i \leq n-1$, and also that every chapter contains at most $100$ pages.

The $(n+2)$-th line contains a single integer $k$ ($1 \leq k \leq r_n$) — the index of the marked page. 


-----Output-----

Print a single integer — the number of chapters which has not been completely read so far.


-----Examples-----
Input
3
1 3
4 7
8 11
2

Output
3

Input
3
1 4
5 9
10 12
9

Output
2

Input
1
1 7
4

Output
1



-----Note-----

In the first example the book contains $11$ pages and $3$ chapters — $[1;3]$, $[4;7]$ and $[8;11]$. Nastya marked the $2$-nd page, so she finished in the middle of the $1$-st chapter. So, all chapters has not been read so far, so the answer is $3$.

The book in the second example contains $12$ pages and $3$ chapters too, but Nastya finished reading in the middle of the $2$-nd chapter, so that the answer is $2$.

Difficulty: interview

Starter code:

Solutions:
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())

n = ii()
a = [li() for _ in range(n)]
k = ii()
ans = 0
for l, r in a:
    ans += k <= r
print(ans)

n = int(input())
a = []
for i in range(n):
    a.append([int(j) for j in input().split()])
k = int(input())
ans = n
for i in range(n):
    if k > a[i][1]:
        ans -= 1
print(ans)


n = int(input())
b = []
for i in range(n):
    tl, tr = list(map(int, input().split()))
    b.append((tl, tr))
k = int(input())
ans = 0
for l, r in b:
    if k <= r:
        ans += 1
print(ans)


n = int(input())
arr = [list(map(int, input().split())) for i in range(n)]
k = int(input()) - 1
cnt = 0
for el in arr:
	if el[1] <= k:
		cnt += 1
print(n - cnt)

hop = []
for i in range(int(input())):
    a, b = map(int, input().split())
    hop.append(b)
k = int(input())
for i in range(len(hop)):
    if k <= hop[i]:
        print(len(hop) - i)
        break

n = int(input())
a = []
for i in range(n):
	l, r = list(map(int, input().split()))
	a.append((l, r))
q = int(input())
k = 0
for i in a:
	if q > i[1]:
		k += 1
print(n -k)


n = int(input())
a = []
for i in range(n):
    x, y = map(int, input().split())
    a.append(y)
p = int(input())
for i in range(n):
    if p <= a[i]:
        print(n - i)
        break

n = int(input())
l = []
for i in range(n):
    l.append(list(map(int, input().split())))
page = int(input())

out = 0
for ch in l:
    if ch[-1] >= page:
        out += 1

print(out)


n = int(input())
a = []
for i in range(n):
	l, r = map(int, input().split())
	a+=[(l, r)]
k = int(input())

count = 0
for l, r in a:
	if not r<k:
		count += 1
print(count)

from sys import stdin, stdout
from math import sqrt, pi, acos, gcd, atan2, cos, sin, factorial
from decimal import Decimal
PEPS = 1e-10
INF = float('inf')


def sqr(a):
    return a * a


def dist(a, b = (0, 0)):
    return sqrt(sqr(a[0] - b[0]) + sqr(a[1] - b[1]))


def s_dist(a, b = (0, 0)):
    return (sqr(a[0] - b[0]) + sqr(a[1] - b[1]))


def dist3(a, b = (0, 0, 0)):
    return sqrt(sqr(a[0] - b[0]) + sqr(a[1] - b[1]) + sqr(a[2] - b[2]))


def s_dist3(a, b = (0, 0, 0)):
    return (sqr(a[0] - b[0]) + sqr(a[1] - b[1]) + sqr(a[2] - b[2]))


def trans(p, al):
    return (p[0] * cos(al) + p[1] * sin(al), - p[0] * sin(al) + p[1] * cos(al))


def get_angle(a, b, c):
    cos_al = (sqr(a) + sqr(b) - sqr(c)) / (2 * a * b)
    return acos(cos_al)


def write_float(ans):
    stdout.write(str('%.6f' % ans) + '\n')


def get_hight(pt1, pt2, pt3):
    a = (pt2[0] - pt1[0], pt2[1] - pt1[1])
    b = (pt3[0] - pt1[0], pt3[1] - pt1[1])
    return abs(a[0] * b[1] - a[1] * b[0]) / dist(pt1, pt2)


def get_square(pt1, pt2, pt3):
    a = (pt2[0] - pt1[0], pt2[1] - pt1[1])
    b = (pt3[0] - pt2[0], pt3[1] - pt2[1])
    return (a[0] * b[-1] - a[1] * b[0]) / 2


def sign(v):
    if v > 0:
        return 1
    elif v < 0:
        return -1
    else:
        return 0


def inn(pt, triangle):
    signs = set()
    signs.add(sign(get_square(triangle[0], triangle[1], pt)))
    signs.add(sign(get_square(triangle[1], triangle[2], pt)))
    signs.add(sign(get_square(triangle[2], triangle[0], pt)))
    return len(signs) == 1


def inter_in(a, b):
    return dist((a[0], a[1]), (b[0], b[1])) < a[-1] + b[-1]


def inter_in3(a, b):
    return dist3(a[:-1], b[:-1]) < a[-1] + b[-1]


def shift(what, wth):
    return (what[0] - wth[0], what[1] - wth[1])


n = int(stdin.readline())
chal = []

for i in range(n):
    l, r = map(int ,stdin.readline().split())
    chal.append((l, r))

k = int(stdin.readline())
ans = 0

for p in chal:
    if p[1] >= k:
        ans += 1

stdout.write(str(ans))

# -*- coding: utf-8 -*-


def rli():
    return list(map(int, input().split()))


def main():
    n = int(input())
    ns = []
    for i in range(n):
        x, y = rli()
        ns.append((x, y))
    w = int(input())
    for i in range(n):
        x, y = ns[i]
        if y >= w:
            print(n - i)
            return


def __starting_point():
    main()

__starting_point()

# -*- coding: utf-8 -*-
# @Time    : 2019/3/12 0:35
# @Author  : LunaFire
# @Email   : gilgemesh2012@gmail.com
# @File    : A. Nastya Is Reading a Book.py


def main():
    n = int(input())
    lr = [list(map(int, input().split())) for _ in range(n)]
    k = int(input())

    ret = 0
    for i in range(n):
        if lr[i][1] >= k:
            ret += 1
    print(ret)


def __starting_point():
    main()
__starting_point()

import getpass
import math
import sys
import string
import re
import math
import random
from decimal import Decimal, getcontext


def ria():
    return [int(i) for i in input().split()]


if getpass.getuser() != 'frohenk':
    filename = 'half'
    # sys.stdin = open('input.txt')
    # sys.stdout = open('output.txt', 'w')
else:
    sys.stdin = open('input.txt')
    # sys.stdin.close()

n = ria()[0]
ar = []
for i in range(n):
    ar.append(ria())
lk = ria()[0]
cnt = 0
lk -= 1
for l, r in ar:
    if l <= lk and r <= lk:
        cnt += 1
print(n - cnt)


n = int(input())
d = []
for _ in range(n):
    l, r = [int(item) for item in input().split()]
    d.append([l, r])

k = int(input())

ans = 0
for i in range(n):
    l, r = d[i]
    if r >= k:
        ans = i
        break

print(n - ans)


n=int(input())
tot=[]
for i in range(n):
    a,b=[int(x) for x in input().split()]
    tot.append((a,b))
k=int(input())
counter=0
for item in tot:
    if item[0]<=k<=item[1]:
        print(n-counter)
        break
    counter+=1


n = int(input())
arr = []
for i in range(n):
	a, b = map(int, input().split())
	arr.append([a, b])
k = int(input())
for i in range(n):
	l = arr[i][0]	
	r = arr[i][1]
	if r >= k:
		ind = i
		break
print(n - ind)

n=int(input())
arr=[]
for i in range(n):
	a,b=list(map(int,input().split()))
	arr.append((a,b))
page=int(input())
ans=0
for i in range(n):
	if(arr[i][0]<=page<=arr[i][1]):
		ans=i
print(n-ans)




n = int(input())
A = [list(map(int, input().split())) for i in range(n)]
k = int(input())
ans = 0
for i in range(n):
  l, r = A[i]
  if k <= r:
    ans += 1
print(ans)


#      
import collections, atexit, math, sys, bisect 

sys.setrecursionlimit(1000000)

isdebug = False
try :
    #raise ModuleNotFoundError
    import pylint
    import numpy
    def dprint(*args, **kwargs):
        #print(*args, **kwargs, file=sys.stderr)
        # in python 3.4 **kwargs is invalid???
        print(*args,  file=sys.stderr)
    dprint('debug mode')
    isdebug = True
except Exception:
    def dprint(*args, **kwargs):
        pass


def red_inout():
    inId = 0
    outId = 0
    if not isdebug:
        inId = 0
        outId = 0
    if inId>0:
        dprint('use input', inId)
        try:
            f = open('input'+ str(inId) + '.txt', 'r')
            sys.stdin = f #标准输出重定向至文件
        except Exception:
            dprint('invalid input file')
    if outId>0:
        dprint('use output', outId)
        try:
            f = open('stdout'+ str(outId) + '.txt', 'w')
            sys.stdout = f #标准输出重定向至文件
        except Exception:
            dprint('invalid output file')
            
        atexit.register(lambda :sys.stdout.close())     #idle 中不会执行 atexit

if isdebug and len(sys.argv) == 1:
    red_inout()

def getIntList():
    return list(map(int, input().split()))            

def solve(): 
    pass
    
T_ = 1    
#T_, = getIntList()

for iii_ in range(T_):
    #solve()
    N,  = getIntList()
    #print(N)
    zz = []
    for i in range(N):
        l,r = getIntList()
        zz.append((l,r))
    x, = getIntList()
    for i in range(N):
        l,r  = zz[i]
        if l<=x<=r:
            print(N-i)
            break
 
 


n = int(input())
A = []
for i in range(n):
    a, b = list(map(int, input().split()))
    A.append((a, b))
k = int(input())
for i in range(n):
    if k >= A[i][0] and k <= A[i][1]:
        print(n - i)
        break


n = int(input())
l = []
r = []
for i in range(n):
    l1, r1 = map(int, input().split())
    l.append(l1)
    r.append(r1)
k = int(input())
res = 1
for el in l:
    if k < el:
        res += 1
print(res)

n = int(input())
l = list()
r = list()
for i in range(n):
    x, y = list(map(int, input().split()))
    l.append(x)
    r.append(y)
k = int(input())
ans = 0
for i in range(n):
    if k <= r[i]:
        ans += 1
print(ans)




l=[]
r=[]
n=int(input())
for i in range(n):

	s=input().split(" ")
	l.append(int(s[0]))
	r.append(int(s[1]))

k=int(input())

rem=n


i=0


for i in range(n):
	if(l[i]<=k<=r[i]):
		break
	rem-=1
print(rem)




n=int(input())
a=[0]*50001
for i in range(n):
    l,r=list(map(int,input().split()))
    for j in range(l,r+1):
        a[j]=i
k=int(input())
print(n-a[k])


n=int(input())
a=[]
for i in range(n):
    a.append(list(map(int,input().split())))
k=int(input())
for i in range(n):
    if a[i][1]>=k:
        print(n-i)
        break