F. Difficult mountain
time limit per test
2 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output
Examples
Input
3 2
2 6
3 5
5 7
Output
2
Input
3 3
2 4
6 4
4 6
Output
2
Input
5 0
1 5
4 8
2 7
7 6
3 2
Output
3