human
Another programming contest is over. You got hold of the contest's final results table. The table has the following data. For each team we are shown two numbers: the number of problems and the total penalty time. However, for no team we are shown its final place.

You know the rules of comparing the results of two given teams very well. Let's say that team a solved pa problems with total penalty time ta and team b solved pb problems with total penalty time tb. Team a gets a higher place than team b in the end, if it either solved more problems on the contest, or solved the same number of problems but in less total time. In other words, team a gets a higher place than team b in the final results' table if either pa > pb, or pa = pb and ta < tb. 

It is considered that the teams that solve the same number of problems with the same penalty time share all corresponding places. More formally, let's say there is a group of x teams that solved the same number of problems with the same penalty time. Let's also say that y teams performed better than the teams from this group. In this case all teams from the group share places y + 1, y + 2, ..., y + x. The teams that performed worse than the teams from this group, get their places in the results table starting from the y + x + 1-th place.

Your task is to count what number of teams from the given list shared the k-th place. 

Input

The first line contains two integers n and k (1 ≤ k ≤ n ≤ 50). Then n lines contain the description of the teams: the i-th line contains two integers pi and ti (1 ≤ pi, ti ≤ 50) — the number of solved problems and the total penalty time of the i-th team, correspondingly. All numbers in the lines are separated by spaces. 

Output

In the only line print the sought number of teams that got the k-th place in the final results' table.

Examples

Input

7 2
4 10
4 10
4 10
3 20
2 1
2 1
1 10

Output

3

Input

5 4
3 1
3 1
5 3
3 1
3 1

Output

4

Note

The final results' table for the first sample is: 

  * 1-3 places — 4 solved problems, the...
The above is tricky. Write me a correct solution in PYTHON3.
 Give me a Python program to print the sought number of teams that got the k-th place in the final results' table?
assistant
#Here is Python program to print the sought number of teams that got the k-th place in the final results' table.

#!/usr/bin/env python
import os
import re
import sys
from bisect import bisect, bisect_left, insort, insort_left
from collections import Counter, defaultdict, deque
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from io import BytesIO, IOBase
from itertools import (
    accumulate, combinations, combinations_with_replacement, groupby,
    permutations, product)
from math import (
    acos, asin, atan, ceil, cos, degrees, factorial, hypot, log2, pi, radians,
    sin, sqrt, tan)
from operator import itemgetter, mul
from string import ascii_lowercase, ascii_uppercase, digits

def inp():
    return(int(input()))

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

def instr():
    s = input()
    return(list(s[:len(s)]))

def invr():
    return(map(int, input().split()))

def b_seach(n, d):
    l = 0
    r = n
    while l <= r:
        mid = l + (r - l)//2
        tot = mid + int(ceil(d / (mid + 1)))
        if tot <= n:
            return mid
        l = mid + 1
    return -1

def main():
    # sys.stdin = open('input.txt', 'r')
    # sys.stdout = open('output.txt', 'w')

    n, k = invr()
    k -= 1
    a = []
    for _ in range(n):
        a.append(inlist())
    a = sorted(a, key=lambda d: d[0]*100 - d[1], reverse=True)
    res = 1
    l = k-1
    r = k+1
    target = a[k]
    while l >= 0:
        temp = a[l]
        if temp[0] == target[0] and temp[1] == target[1]:
            res += 1
        else:
            break
        l -= 1
    while r < n:
        temp = a[r]
        if temp[0] == target[0] and temp[1] == target[1]:
            res += 1
        else:
            break
        r += 1
    print(res)

    # region fastio
BUFSIZE = 8192

class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b =...