P11902 [AOJ] New Game AI
普及
题目描述

Example

Input

5 3
1 5
3 4
5 3
7 2
9 1

Output

5

输入格式

见题面

输出格式

见题面

样例输入
5 3 1 5 3 4 5 3 7 2 9 1
样例输出
5